getting exception when adding data to Timeseries Chart
getting exception when adding data to Timeseries Chart
I tryed to change the MemoryUsage Chart to take in data that I generate but when I call free.add(new Millisecond(), y); with data I am generating I get an exception saying that I can not add duplicate data and that I already added data at a specified time. Do you know what is going on and how can I fix this. Or can someone send some source. Basically I am just trying to get a basic realtime chart going so am using this example but modified it slilghtly to take in my data.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Probably there isn't sufficient delay between the creation of the Millisecond objects, so you end up with two Milliseconds for the same period in time. The TimeSeries class won't let you add a new observation for a period that already exists in the series.
In the MemoryUsage demo, there is a timer that ensures that an observation is added to the series only once per 100 milliseconds, so this problem is avoided.
In the MemoryUsage demo, there is a timer that ensures that an observation is added to the series only once per 100 milliseconds, so this problem is avoided.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

