It seems to me that when the XYLineChart was used to create plots, the data was
sorted with increasing X values. I need to plot in a sequence of increasing Y values.
How do I achieve that?
Thanks,
Jane
Problem with XYLineChart
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
It is the dataset class that is sorting by x-value. There is an option in the constructor to enable/disable this.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
I am making a guess that you are using the XYSeries class (and XYSeriesCollection). It has this constructor that you can use when you create the series:
You need to pass 'false' for the 'autoSort' argument.
Code: Select all
public XYSeries(java.lang.Comparable key, boolean autoSort);
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

