XYSeries update not work

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
sesar
Posts: 12
Joined: Fri Jul 13, 2007 10:57 am

XYSeries update not work

Post by sesar » Sun Dec 02, 2007 11:57 pm

Hi,my problem is that

I use XYSeries, and when I call update method it doesn't update my chart?

How can I update my chart with XYSeries on dataset?

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Dec 03, 2007 4:24 pm

Most likely the XYSeries you are updating doesn't actually belong to the XYSeriesCollection being displayed in the chart. But I can't tell for sure because you posted hardly any information.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

sesar
Posts: 12
Joined: Fri Jul 13, 2007 10:57 am

Post by sesar » Mon Dec 03, 2007 9:23 pm

I use:

XYSeriesCollection DATASET
XYSeries SERIES

The chart displays dataset correctly.

I check values of series as follows:

for i
DATASET .getSeries(0).getDataItem(i).getY()

and it shows the same values of SERIES that was set.

Next step is updating my series, I tried two ways:

DATASET.getSeries(0).update(new Double(0), new Double(5));
DATASET.getSeries(0).updateByIndex(0, new Double(5));

Then, I check new value (in both ways):

DATASET.getSeries(0).getDataItem(0).getY()

and it correctly shows me new updated value (5), but chart is constantly showing not-updated series (even if I call chartPanel.repaint())

How can I refresh my chart with updated series?

Locked