real-time charting with many non-visible data

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
realtracksystems
Newbie
Newbie
Posts: 11
Joined: Fri Sep 18, 2009 12:00 am

real-time charting with many non-visible data

Post by realtracksystems » Tue Jul 27, 2010 7:34 am

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

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

Post by Narcís » Wed Jul 28, 2010 8:35 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

realtracksystems
Newbie
Newbie
Posts: 11
Joined: Fri Sep 18, 2009 12:00 am

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

Post by realtracksystems » Wed Jul 28, 2010 3:27 pm

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.

Post Reply