views:

325

answers:

1

Hi,

I'm doing a GUI that has a XYPlot (from the JFreeChart package) and when I click a button I'm trying to add some values. I add them correctly to the XYSeries that are inside the XYPlot, but the GUI doesn't change. It only changes when y maximize or minimize. Is there some kind of repaint to do this? I have been looking for it and I have found nothing.

A: 

The add() methods of XYSeries send a SeriesChangeEvent to all registered listeners, some optionally; and the ChartPanel content "is redrawn automatically whenever this notification is received."

You might compare what you're doing with org.jfree.chart.demo.TimeSeriesChartDemo1. Similarly, this example shows the effect of dynamically adding series to a data set.

trashgod
I have executed this code and it doesn't seem to add data to the dataset after the view is shown. Am I wrong? Thanks
mccrank
The first example does not; second example does.
trashgod