Empty chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Prabhakar Chaganti

Empty chart

Post by Prabhakar Chaganti » Thu Jan 31, 2002 4:06 am

All:

I am trying to create a chart with timeseries data. Time data on the x-axis and the values itself on the y-axis. I am doing the following to create this chart:
1. Create a TimeSeriesDataPair with a timeperiod of type DAY, and a Double value.
2. Create a BasicTimeSeries and add the above TimeSeriesDataPair to it.
3. Add the above BasicTimeSeries to a TimeSeriesCollection.
4. Create a CombinedDataset and add the above TimeSeriesCollection. to it.
5. Create a new HorizontalDateAxis("Time").
6. Create a new VerticalNumberAxis("Value");
7. Use ChartFactory to a createCombinableTimeSeriesChart
using the above hda,vna,and the CombinedDataset.
8. Create a JFreeChartFrame with the above chart.
9. Pack and make it visible.

Here is the problem:
I get an empty chart(no data points) displayed on the screen.
The xaxis and y-axis have the right tick mark values. I printed out the values in the BasicTimeSeries and it has the right values. What step am I missing. I am trying to follow the tutorial in the pdf from the website.

Any info really appreciated.

thanks
prabhakar

David Gilbert

RE: Empty chart

Post by David Gilbert » Thu Jan 31, 2002 9:46 am

Hi Prabhakar,

If you have only one time series, you don't need to create a combinable time series chart - just use ChartFactory.createTimeSeriesChart(...).

Also, do you have more than one data value. I think with a single data value you won't see anything on the chart...

Regards,

DG.

Locked