Dynamic display of series

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

Dynamic display of series

Post by Soo Hom » Tue Aug 08, 2000 7:30 pm

I would like to display a new curve in a xy-plot without clearing the previous curves in the chart. Currently I can achieve this behaviour by creating a new series and redisplaying all the curves again. This method creates a performance issue as the number of series to plot grows.

I really appreciate an answer soon.

David Gilbert

RE: Dynamic display of series

Post by David Gilbert » Wed Aug 09, 2000 6:20 am

JFreeChart doesn't do this very well, as you've observed, because my original requirement was to draw static charts only. However, I can understand that dynamic charts are useful to other developers.

I think what is required is some modifications to the DataSourceChangeEvent so that the DataSourceChangeListener (usually the Plot) can identify *exactly* what has changed and, if possible, do an incremental draw() rather than redrawing everything.

It will be quite tricky--but not impossible--to implement:

- changing data in existing series could mean that the 'auto' axis range needs updating, which will require the chart to be redrawn anyway;

- adding a new series (or deleting an existing one) will potentially affect the 'auto' axis range too, and will also require the chart legend (if there is one) to be updated, and this might change the layout of the overall chart;

- it needs to support changes to existing data items within a series;

I'll put it on the TO DO list (I'm not likely to have time to work on this for a while, but maybe someone else will).

Regards,

DG.

Locked