Hi
Please bear with me I am new to using JFreeChart. I have looked through most of the forum and solved some qustions but can't resolve the one below.
I am trying to display 4 series of data as a line graph. The Y axis represents Kg of milksolids and the X axis is months of the year in the order of Jun - May.
I started off using a LineChart but the double[][] series does not allow null's. I do could not work out how to only mak the line begin at the first available value in a data series.
What I am trying to do is only display a line for months that data was recorded for. e.g. one series may only have one recording in May and none for the others. A second series recording for Jun-Aug etc.
Thus I do not want a line going along the bottom of the chart and suddenly go up to the first reading in a series. I want the line to start at the first value.
I then tried doing this using a TimeSeriesCollection which solved that problem for me but it put the months of the year in the order of Jan - Dec not the order I put them in - Jun-May. I also want to get rid of the year as part of the category label e.g have "Jun" not "Jun-2003"
Kind Regards
Hugo
omit null data from graph
Re: omit null data from graph
Using the TimeSeries/TimeSeriesCollection classes should work...the order will be in ascending date order, so Jun 2002 will appear before May 2003. Each series in the collection can have different observation dates, the chart will only draw lines for the points in each series that have values. The label on the axis can be controlled using the setTickUnit(...) method in the axis.
Regards,
Dave Gilbert
Regards,
Dave Gilbert