Hello,
I'm trying to plot a relatively large TimeSeries data set (about 2000 data points) and it takes almost 1 minute to plot! I changed the renderer from XYLineAndShapeRenderer to SamplingXYLineRenderer but it made no difference. I also tried to add data and create the data set before I create the plot but without any improvement.
Any ideas on how to work around this issue would be very much appreciated.
Thanks a lot!
Slow performance with large TimeSeries Dataset
-
- Posts: 16
- Joined: Thu Jan 19, 2017 5:54 pm
- antibot: No, of course not.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Slow performance with large TimeSeries Dataset
You should post some sample code, because almost certainly something else is happening...2000 data points won't take a fraction of a second.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
-
- Posts: 16
- Joined: Thu Jan 19, 2017 5:54 pm
- antibot: No, of course not.
Re: Slow performance with large TimeSeries Dataset
Thanks for your reply.
You were right, I was retrieving the data from a database which created the additional delay. Now this is fixed and plots up to 5E4 data points are generated fast, I've noticed however that beyond that the delay (around 10 sec) is inevitable, which I suppose is expected (?).
You were right, I was retrieving the data from a database which created the additional delay. Now this is fixed and plots up to 5E4 data points are generated fast, I've noticed however that beyond that the delay (around 10 sec) is inevitable, which I suppose is expected (?).
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: Slow performance with large TimeSeries Dataset
That depends on how exactly you use your TimeSeries. If you first create your chart with an empty dataset, and then, while the chart is already visible, add new items to your TimeSeries without disabling the event notification, you will force one redraw for each item. Under these conditions, 10 sec for 50k data points looks reasonable. The actual speed is also dependent on the renderer.
If speed is a major concern, I would not use a TimeSeries, but e. g. a DefaultXYDataset. This dataset can also be used to construct a time series chart, though it may be a bit less intuitive.
If speed is a major concern, I would not use a TimeSeries, but e. g. a DefaultXYDataset. This dataset can also be used to construct a time series chart, though it may be a bit less intuitive.
-
- Posts: 16
- Joined: Thu Jan 19, 2017 5:54 pm
- antibot: No, of course not.
Re: Slow performance with large TimeSeries Dataset
As you said, first I create the dataset and then I create the chart and add the dataset to it. The renderer is a simple XYLineAndShapeRenderer. However, I will consider your suggestion about the DefaultXYDataset.
Thanks a lot!
Thanks a lot!