Recent

Author Topic: options for having TChart show lots of data  (Read 10242 times)

mas steindorff

  • Hero Member
  • *****
  • Posts: 565
options for having TChart show lots of data
« on: March 03, 2011, 11:35:21 pm »

I have added a tchart to my software so I can look at some of my data sets.
I've found (as one would expect) that my system slows down after adding more than 26,000 points. 
What I think I need is more of a summery of points where I only plot 1 in N points after exceeding X number of total points.
I would like to see general trend of the data visually so I could just average the data segments but I also need to see all of the spikes that may only last one or two data points.

Does any one have any suggestions for a decimation algorithm?
At this point, The only one I've come up with is to have 2 points/epoch [Min & Max] where the epoch is like 0.1% of the total number of points to show. 

It would be great if I could summarize 6 channel with 720K points each = 30 minutes out of a 30 day data set within a few seconds.

windows 10 &11, Ubuntu 21+ IDE 3.4 general releases

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: options for having TChart show lots of data
« Reply #1 on: March 04, 2011, 01:31:19 am »
What kind of series you use? If it is line series, you can try to make use of fast drawing
optimizations. See line demo for an example.

On my (fast) computer, I get 0.9 sec per refresh for 4,1*10^6 points.
You may also use Sorted property to substantially speed up zoomed-in drawing
in this case.

mas steindorff

  • Hero Member
  • *****
  • Posts: 565
Re: options for having TChart show lots of data
« Reply #2 on: March 04, 2011, 02:02:53 am »
What kind of series you use? If it is line series, you can try to make use of fast drawing
optimizations. See line demo for an example.

I'm using a line series.  I've looked at the TAchart demos that came with 9.28.2 and could not find any referferance to a "fast" properties in the demo code.  I've also looked at the TChart properties the object inspector shows and can only see the .Doublebuffered field which I have set to true.

On my (fast) computer, I get 0.9 sec per refresh for 4,1*10^6 points.
You may also use Sorted property to substantially speed up zoomed-in drawing
in this case.
I could live with that speed.  I understand there is a newer update in the daliy repo.  I can not update my rev of lazarus due to ongoing projects but is there more details /demos for the tchart in there?  I see one of the demos uses TAChartUtils but I'm not sure what options it adds to the tchart or how to wire it up if I did use it.
windows 10 &11, Ubuntu 21+ IDE 3.4 general releases

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: options for having TChart show lots of data
« Reply #3 on: March 04, 2011, 05:39:37 am »
I could live with that speed.  I understand there is a newer update in the daliy repo.  I can not update my rev of lazarus due to ongoing projects but is there more details /demos for the tchart in there?  I see one of the demos uses TAChartUtils but I'm not sure what options it adds to the tchart or how to wire it up if I did use it.

Line series optimization is in 0.9.30 version, as well as other improvements.
See http://wiki.freepascal.org/Lazarus_0.9.30_release_notes#TAChart for the list of changes.

Maybe you can use newer TAChart with old Lazarus, but I am not sure of that.


mas steindorff

  • Hero Member
  • *****
  • Posts: 565
Re: options for having TChart show lots of data
« Reply #4 on: March 15, 2011, 12:02:42 am »
Line series optimization is in 0.9.30 version, as well as other improvements.
See http://wiki.freepascal.org/Lazarus_0.9.30_release_notes#TAChart for the list of changes.

Maybe you can use newer TAChart with old Lazarus, but I am not sure of that.
I was able to download the new components from the svn.  unfortunately I am unable to open the demo with my rev of Lazarus, I keep getting an error "LCLbase" missing.  Is LCLbase something in the tachart or another component?
 
I'm now looking for a "chart recorder" like option for my next task.  I only want to show the last 10 seconds of these large data sets.
If my update rate was 1/sec, then I think I need to keep clearing the lineseries and re-add the last 9 seconds + new data in order to show the data correctly and to keep the memory usage under control. I tried using the .delete to remove the oldest data but this killed the auto scaler and the X axis remained at the last value.  perhaps someone has a better ideal?
windows 10 &11, Ubuntu 21+ IDE 3.4 general releases

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: options for having TChart show lots of data
« Reply #5 on: March 15, 2011, 06:11:47 pm »
Quote
I was able to download the new components from the svn.
Did you install it successfully?

Quote
Is LCLbase something in the tachart or another component?
It is the non-visual part of LCL.
See http://lists.lazarus.freepascal.org/pipermail/lazarus/2011-January/059988.html

I still think the simplest option for you is to just download and install the snapshot build.

Quote
I tried using the .delete to remove the oldest data but this killed the auto scaler and the X axis remained at the last value.

Please post an example code demonstrating you problem.

 

TinyPortal © 2005-2018