Page 1 of 1

TFastLine Performance with big series

Posted: Wed Jun 08, 2005 10:44 am
by 8578138
I'm using Borland C++ Builder 6 with Teechart Pro 6.01 VCL

Problem:
FastLineSeries with big data arrays (>= 2M data)

Each operation in this chart (draw, zoom, etc.) blocks the main program and the other threads (for measuring) from working for a certain time (sometimes 5 s or more).

How can I accelerate this. Is it possible to use the TeeChart in a separate thread ? Is there an example for this ?

Thanks,

Rainer Zieschang

Posted: Wed Jun 08, 2005 11:40 am
by narcis
Hi Rainer,

To optimize real-time charting performance you should follow this article advise. It's Delphi written, however you won't have any problem porting it to BCB.

If the mentioned article doesn't help you could you please send us an example we can run "as-is" to reproduce the problem here?

You can post your examples at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.

Posted: Wed Jun 08, 2005 2:46 pm
by 8578138
Hi Narcis,

I use already many features mentioned in the article.

The whole project is too big and depends on various hardware drivers for data acquisition.

For the problem part see the
attachment in news://www.steema.net/steema.public.attachments

I can not use the option
Series1->DrawAllPoints = false;

because the series plot in the lower chart (see picture) then shows not all the information. (The example contains 2*1048576 data points)

Executing the line
Series1->Repaint();
or zooming in this chart or simple resizing the window
blocks the main program and the other threads in the background (for measuring) from working for a certain time (sometimes 5 s or more).

I remember reading the VCL is not Thread-safe and therefore must be used from the main program.

Or can the chart be operated in a separate thread ?


Thanks,
Rainer

Posted: Wed Jun 08, 2005 5:19 pm
by 9333098
With 2,000,000 points, about 1000 points are being plotted at each pixel. Have you tried the DownSampling function ? Or perhaps manually determine the number of points plotted per pixel and go through each sub-section of such plotted data and determine the local min and max and only plot that.

I'm surprised 2M points takes 5 sec to plot, especially if you use TChartValues(X) dynamic arrays.

Can your data acquisition be done in a separate thread from the main TChart program ?

Steve

Posted: Thu Jun 09, 2005 8:50 am
by 8578138
Hi Steve,

for 2M points the time necessary to redraw the series depending on zoom status is from 2 s up to 4 s.

The data acquisition is already done in a separate thread and the problem is the drawing of the series blocks the main program and the thread from working so some data are lost.

Rainer