Dynamic Charts using JFreeChart

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

Dynamic Charts using JFreeChart

Post by Reji Mani » Thu Jan 17, 2002 10:09 am

Hi,

Currently I am trying to develop a prototype to monitor Database performance using Swing as GUI. I am using JFreeChart for plotting TimeSeries Charts with, number of series ranges from 3 to 16 and refresh interval from 1 second to 5 seconds.

Now what I am doing is, delete oldest data from vector and add new data for each refresh, prepare new XYDataset and set new Dataset to chart. Does anybody have better idea?

Thanks

David Gilbert

RE: Dynamic Charts using JFreeChart

Post by David Gilbert » Thu Jan 17, 2002 6:39 pm

Hi Reji,

When you update your dataset, notify all the registered listeners (the JFreeChart object will be one of them) that the data has changed, and the chart will automatically be redrawn.

You don't have to completely replace the dataset every time...
Regards,

DG.

Locked