Reload Data

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

Reload Data

Post by Phil » Thu Jul 25, 2002 2:10 pm

Hi,

What is the better system for reload data in curve for redisplay whith the basictime series

Regards

Phil

David Gilbert

Re: Reload Data

Post by David Gilbert » Thu Jul 25, 2002 3:10 pm

Hi Phil,

I'm not sure what you mean...are you looking to save and restore data from a time series?

Regards,

DG.

Phil

Re: Reload Data

Post by Phil » Thu Jul 25, 2002 4:07 pm

Hi dave,

My problem is : I have a SQL system with a "summit button". When the user ask for a new serie of data i would like change the curve without create some new object like jfreechart or ChartPanel.

I want just set a new serie of time and redraw the curve in an existing ChartPanel object.

Regards,

Phil.

David Gilbert

Re: Reload Data

Post by David Gilbert » Thu Jul 25, 2002 8:25 pm

If you create a new series, then you should wrap it up with a TimeSeriesCollection (because this implements the XYDataset interface) and:

JFreeChart chart = myPanel.getChart();
XYPlot plot = chart.getXYPlot();
plot.setDataset(myTimeSeriesCollection);

At least I think that should work (off the top of my head).

Regards,

DG.

Phil

Re: Reload Data

Post by Phil » Fri Jul 26, 2002 10:22 am

Hi David,

That works well, thanks

Regards,

Phil

Locked