Refresh issue in TimeSeriesCollection with multiple series

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
d_rambabu
Posts: 8
Joined: Mon Apr 14, 2008 8:36 am
Location: Hyderabad, India
Contact:

Refresh issue in TimeSeriesCollection with multiple series

Post by d_rambabu » Fri Jul 18, 2008 7:53 am

Hi,
I am using a TimeSeriesCollection with 4 time series in it. I am adding data in these series periodically(every 1s). Since each series add, refreshes the chart separately, the chart is getting refreshed 4 times than expected. This is resulting in high CPU usage. Is there a way to override the chart refresh, while adding data into the time series so that refresh can be called manually after adding data into all the 4 series?

-Rambabu

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 » Fri Jul 18, 2008 8:50 am

Do something like:

Code: Select all

chart.setNotify(false);
// update your dataset here
chart.setNotify(true);
David Gilbert
JFreeChart Project Leader

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

Locked