Hi,
I am using XYPlot and a series dataset that is implementing XYDataset,CategoryDataset,IntervalXYDataset interfaces
I am plotting 3 line graphs in XY plot.
I am using HorizontalDateAxis for the X axis .
Now SeriesDataset is implemented in such a way that If it does not have data for a particular date then it returns 'null'.Due to this I amgetting gaps in between the lines and not getting the continuous lines.
Can I do something like , if there is no data for a particular date then skip that Date.
If I skip that Date then I will get a continuous line.
Any pointers would be of great help.
My code is as follows.
--------------------------------------------------------------------------------------
private void createChart(List list) {
HorizontalDateAxis haxis = new HorizontalDateAxis("Zeit");
SeriesDataset dataset = new SeriesDataset(list, SeriesDataset.PRICE);
dataset.setDateFormat(DateFormat.DAILY);
XYStepRenderer renderer = new XYStepRenderer();
VerticalNumberAxis vAxis = new VerticalNumberAxis("%");
XYPlot plot = new XYPlot(dataset, haxis, vAxis, renderer );
setChart(new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, plot, true) );
}
--------------------------------------------------------------------------------------
Thanks in Advance,
Deepak.
skipping the date which does not have data?
Re: skipping the date which does not have data?
Hi Deepak,
The code is set up to draw a discontinuous line if there is a null value. You need to modify your dataset so that it only returns (date, value) pairs where there actually is data. Note that there is no requirement for the date values to be evenly spaced, you can return data at irregular points if you need to.
Regards,
Dave Gilbert
The code is set up to draw a discontinuous line if there is a null value. You need to modify your dataset so that it only returns (date, value) pairs where there actually is data. Note that there is no requirement for the date values to be evenly spaced, you can return data at irregular points if you need to.
Regards,
Dave Gilbert
Re: skipping the date which does not have data?
Hi Dave,
Thank you very much Dave...
I will give it a try now
)
Regards,
Deepak.
Thank you very much Dave...
I will give it a try now

Regards,
Deepak.
Re: skipping the date which does not have data?
Hi,
I made a new dataset that returns (date,value).
It worked perfactly fine.
Thanks agin..
Regards,
Deepak.
I made a new dataset that returns (date,value).
It worked perfactly fine.
Thanks agin..
Regards,
Deepak.