Page 1 of 1

real-time charting with many non-visible data

Posted: Tue Jul 27, 2010 7:34 am
by 10554269
Hello. I have a problem with real-time plot. I have several charts with three fastlineseries each.
I insert 1000 values per second but only 10000 values are visible because I do scroll on X axis. The problem is, my application can not clear the values that are hidden when I scroll.
It starts with 20% CPU and it does 100% of CPU consumption in a few minutes. This does not happen when I set fastlineseries.AutoRepaint = false.
The problem is, Y axis is not autoadjusting when fastlineSeries.autoRepaint=false. I have seen in TeEngine.pas that the series call or not call the method Inalidate() of the parent chart when autorepaint is false or true.
There are some other action that is performed when autoRepaint is true? performance declines when the number of data increases, but I always visualize the same amount of data.
I set all the properties as indicated in the article "real time charting."

I have two options:

1 - What I can do to auto-adjust the Y axis without set the series->autorepaint to true?

2 - what happens when chart.Invalidate? I think at that moment it made a loop of all data (visible and non visible data) and perhaps, I can continue without these calculations.

Thanks for your good work.

Re: real-time charting with many non-visible data

Posted: Wed Jul 28, 2010 8:35 am
by narcis
Hi realtracksystems,
1 - What I can do to auto-adjust the Y axis without set the series->autorepaint to true?
I recommend you to scroll points as explained in the Real-time Charting article here.
2 - what happens when chart.Invalidate? I think at that moment it made a loop of all data (visible and non visible data) and perhaps, I can continue without these calculations.
Full chart is repainted. If non-visible data is no longer necessary you could remove it. An alternative would be running the loop from FirstVisibleIndex to LastVisibleIndex instead of looping for all points in the series.

Re: real-time charting with many non-visible data

Posted: Wed Jul 28, 2010 3:27 pm
by 10554269
Hello. Thanks for the reply.
I have read the post "Speed up Live Plotting?" and I made the same changes in "TeEngine.pas". On the other hand, I have modified the method "TChartSeries.CalcFirstLastVisibleIndex" (I have implemented bubble search). It seems that these changes do not affect my application functionality and is now faster.

A greeting.