I am difficulties finding a way to update a chart with new data. One adds data to a chart using:
Configuration conf = chart.getConfiguration();
conf.addSeries(series);
But there is no corresponding "remove(series)"!?! Thus, if I want to update the data being displayed and add another series I actually add another line (or bar-graph or whatever visualization I have chosen) to the chart, which is clearly NOT what I want/need.
My first attempt to overcome that was to get hold of the old data series and remove them from the chart, but with getSeries()
I am only getting a non-modifyable copy of the existing series, so that attempt ended in a java.lang.UnsupportedOperationException
.
Thus my question: how do I convince an existing chart to remove all old data series? Don't tell me, that I need to recreate the entire chart-component each time, please!