Null values in TimeSeries

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
uli
Posts: 24
Joined: Sat Mar 14, 2009 3:22 pm
Location: Berlin

Null values in TimeSeries

Post by uli » Tue Mar 21, 2017 2:57 pm

Hello,

How can I set the behaviour of null values in a Timeseries?
In the examples I found (e.g. here http://www.java2s.com/Code/Java/Chart/J ... lvalue.htm)
the method org.jfree.chart.ChartFactory.createTimeSeriesChart(String, String, String, XYDataset, boolean, boolean, boolean) is used to create the chart.
Here, null values are not shown and the line is disconnected. This is how it should be.

In my case (which are compicated charts not using this Factory method but with many settings for renderes, axes etc.) lines are NOT disconnected at null values. I tried to go through the code, but I could not find the "switch" for this behaviour.

Maybe you can tell me where to look at!

I'm using jfreechart-1.0.19.jar.

Thanks,
Julia

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Null values in TimeSeries

Post by david.gilbert » Tue Mar 21, 2017 5:39 pm

It is the standard behaviour for the renderers in JFreeChart to discontinue lines when there is a null value. There isn't a switch for it. You should double check that you are using a standard renderer and not a custom one. And also that the dataset really does contain the null values...maybe somewhere in your code you exclude them.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

uli
Posts: 24
Joined: Sat Mar 14, 2009 3:22 pm
Location: Berlin

Re: Null values in TimeSeries

Post by uli » Wed Mar 22, 2017 2:04 pm

You were right, null values were not added to the timeseries (sorry for not checking this before). This code is about 10 years old and I read about some bugs with null values those days. Maybe that's why.
Anyway, now it works fine, Thanks!

Locked