How can I get the chart to use months class instead of day like in the demo? Seems I cant get it to work.
Thanks.
TimeSeries Chart using months
Re: TimeSeries Chart using months
Hi Jorge,
There is a new demo application in version 0.8.1 (TimeSeriesDemo) that shows how to create a time series chart for Quarterly data...here's the important part of the code:
this.series = new BasicTimeSeries("Quarterly Data", Quarter.class);
this.series.add(new Quarter(1, 2001), 500.2);
this.series.add(new Quarter(2, 2001), 694.1);
this.series.add(new Quarter(3, 2001), 734.4);
this.series.add(new Quarter(4, 2001), 453.2);
this.series.add(new Quarter(1, 2002), 500.2);
this.series.add(new Quarter(2, 2002), null);
this.series.add(new Quarter(3, 2002), 734.4);
this.series.add(new Quarter(4, 2002), 453.2);
TimeSeriesCollection dataset = new TimeSeriesCollection(series);
JFreeChart chart = ChartFactory.createTimeSeriesChart("Time Series Demo", "Time", "Value", dataset, true);
If you change Quarter.class to Month.class and also change each of the Quarter constructors to an appropriate Month constructor, then the example should work in exactly the same way.
Ask again if that doesn't help...
Regards,
DG.
There is a new demo application in version 0.8.1 (TimeSeriesDemo) that shows how to create a time series chart for Quarterly data...here's the important part of the code:
this.series = new BasicTimeSeries("Quarterly Data", Quarter.class);
this.series.add(new Quarter(1, 2001), 500.2);
this.series.add(new Quarter(2, 2001), 694.1);
this.series.add(new Quarter(3, 2001), 734.4);
this.series.add(new Quarter(4, 2001), 453.2);
this.series.add(new Quarter(1, 2002), 500.2);
this.series.add(new Quarter(2, 2002), null);
this.series.add(new Quarter(3, 2002), 734.4);
this.series.add(new Quarter(4, 2002), 453.2);
TimeSeriesCollection dataset = new TimeSeriesCollection(series);
JFreeChart chart = ChartFactory.createTimeSeriesChart("Time Series Demo", "Time", "Value", dataset, true);
If you change Quarter.class to Month.class and also change each of the Quarter constructors to an appropriate Month constructor, then the example should work in exactly the same way.
Ask again if that doesn't help...
Regards,
DG.