Page 1 of 1
Series.Delete function takes too long with labels
Posted: Thu Jun 16, 2011 8:33 pm
by 10554301
I am using TChart version 8.06 to create a real time graph. When I add the data points via AddXY, I am adding a label for each point. If the users sets up their graph to hold hundred of thousands of data points, and to delete most, or all, of those points when the graph is full, the call to the series's delete function can take a very long time. For example, if I have 500,000 points in my graph, all of which have a label, the function call "series.Delete(0, 499,999)" can take well over 50 seconds. If I do not add a label in the AddXY function, then that same function all takes about 1 millisecond.
Is this a TChart bug, or is there some kind of optimization that I should be doing?
Re: Series.Delete function takes too long with labels
Posted: Tue Jun 21, 2011 10:38 am
by 10050769
Hello slvjm,
Sorry for the delay. I have added your request in wish-list with number [TV52015622] to be consider it inclusion in future versions of TeeChartVCL. On the other hand, I think can be helpful for you, use FastLine Series, so if you use it the problem about performance disappears and the Chart is painted faster, to check it you only have change Point Series to FastLineSeries.
Thanks,
Re: Series.Delete function takes too long with labels
Posted: Tue Jun 21, 2011 2:47 pm
by 10554301
For me, this happens with both the TLineSeries and the TFastLineSeries. However, the drawAllPoints property was set to true. Perhaps setting this to false makes a difference with the TFastLineSeries? I will have to experiment a bit more.
Re: Series.Delete function takes too long with labels
Posted: Wed Jun 22, 2011 1:09 pm
by narcis
Hi slvjm,
Perhaps setting this to false makes a difference with the TFastLineSeries?
Yes, for sure!
DrawAllPoints feature was implemented for performance purposes. There's also
DrawAllPointsStyle property which may help you find the most suitable approach to your needs.