Hello,
i have a problem with the renderer of Jfreechart.
Here are 2 Screenshots:
The top chart is a old software with other technologies, but we know that this graph is right.
In the second chart we can see the lines are not connected to the datapoint. This is just 1 timeSeries.
Does someone have a idea why the chart is drawing the line like this ?
Thanks to everybody for any help!
JfreeChart Renderer draw wrong lines.
-
- Posts: 513
- Joined: Wed Sep 12, 2007 3:18 pm
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: JfreeChart Renderer draw wrong lines.
Please post the code you use to populate the dataset, preferably in a small self-contained demo.
If you are using XYSeries to represent your data, note that by default the series will sort the data items in order of x-values...that might cause the effect you are seeing (but you can easily switch off this feature in the constructor).
If you are using XYSeries to represent your data, note that by default the series will sort the data items in order of x-values...that might cause the effect you are seeing (but you can easily switch off this feature in the constructor).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: JfreeChart Renderer draw wrong lines.
Thank you both for the quick response.
The renderer on the screenshot is a XYItemRenderer (SamplingXYLineRenderer)
First i have implemented the XYStepRenderer as suggested. It looks like this is a solution for my problem.
But i will try the second solution to overwrite the constructor of the XYSeries to avoid sorting the data items, too.
Thank you very much!
The renderer on the screenshot is a XYItemRenderer (SamplingXYLineRenderer)
First i have implemented the XYStepRenderer as suggested. It looks like this is a solution for my problem.
But i will try the second solution to overwrite the constructor of the XYSeries to avoid sorting the data items, too.
Thank you very much!