changing data in XYPlot

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

changing data in XYPlot

Post by Michaela » Mon Feb 04, 2002 12:00 am

How can I "refresh" the plot, if my data changes ?
At the moment, the plot is only refreshed if I make a mouse click on it.

I'm using JFreeChart for the first time, so I need some help.
Thank you
Michaela

David Gilbert

Re: changing data in XYPlot

Post by David Gilbert » Mon Feb 04, 2002 3:01 pm

Hi Michaela,

The JFreeChart object registers itself automatically with the XYDataset to receive DatasetChangeEvent notifications. This registration happens in the JFreeChart constructor, and also the setDataset(...) method.

If you are implementing your own dataset you need to remember to generate the event notifications, otherwise the chart will not be aware that it needs to redraw itself.

Regards,

DG.

Locked