JFreeChartWrapper with dynamic data


I want to display current data with the JFreeChartWrapper. So I collect the data in a thread and put these in a TimeSeries. Then I create a TimeSeriesChart which takes the data from the TimeSeries.

How can I refresh this chart now? When putting new data in the TimeSeries, they aren’t displayed in the chart. At the moment I am repainting the hole TimeSeriesChart. By doing this, the chart flickers every two seconds, which doesn’t look very well.

Any suggestions?


AFAIK the architecture (Java2D->batik->svg) don’t support modifying existing SVG DOM. So the perfect solution isn’t achievable.

Still I think the Vaadin client side implementation (basically VEmbedded.java), could do its updates much better. Currently it swipes away the the old content and then rebuilds the content. Instead it could eagerly build the new content over the previous and then lazily get rid of the old stuff. I’d guess this would resolve the flickering or at least make it less disturbing.

Have you checked Vaadin Timeline (http://demo.vaadin.com/timeline ) ? That should support smooth updates.


Thanks! It works fine.