XYDataSeries does not update

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Raider
Posts: 5
Joined: Fri Dec 01, 2017 9:50 am
antibot: No, of course not.

XYDataSeries does not update

Post by Raider » Fri Jun 08, 2018 9:49 am

I have an issue with updating a XYDataSeries:

With version 1.0.13 it worked to update the dataset using (all elements in series are 0 before):

Code: Select all

XYDataItem item = series_.getDataItem( index );
item.setY( data );
With version 1.0.19 the item1 is set to the new value, but the series does not update.

A workaround has been to update this way:

Code: Select all

series_.updateByIndex(index, data);
But is this a kown problem or has anybody an explanation for this?

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

Re: XYDataSeries does not update

Post by david.gilbert » Fri Jun 08, 2018 3:35 pm

At some point (I think version 1.0.14) I changed the getDataItem() method to return a clone of the object to make it harder for the XYSeries to have its data values changed without triggering a SeriesChangeEvent.
David Gilbert
JFreeChart Project Leader

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

Raider
Posts: 5
Joined: Fri Dec 01, 2017 9:50 am
antibot: No, of course not.

Re: XYDataSeries does not update

Post by Raider » Mon Jun 11, 2018 7:03 am

Ah thank you for this information:)

Locked