Page 1 of 1

TFastLineSeries AutoRepaint Problems

Posted: Thu Aug 11, 2016 3:33 pm
by 16478747
Hello,

I'm updating TeeChart of an old application for realtime data recording.
I use Windows 7 SP1, C++Builder XE5 and the latest TeeChart Pro 2016.18 VCL.

According to all the infos about realtime data, I changed serveral settings in TeeChart.
Now I get a good speed increase when drawing a lot of data from an external device in realtime (10000 values per second).

But unfortunately I also get some problems using the following combination of TFastLineSeries properties:

FastPen = true
AutoRepaint = false
DrawAllPoints = false
DrawAllPointsStyle = daMinMax

1. Problem
Clipping is not working. I set chart ClipPoints = true, but the line is drawn outside the chart axis.
A chart repaint (e.g. unzoom with mouse) corrects the problem.

2. Problem
If I set FastPen = true, the color of the series is wrong.
A chart repaint corrects the problem.

3. Problem
Some of the series values are not shown in the chart. This error only appears, if AutoRepaint = false AND DrawAllPoints = false.
A chart repaint corrects the problem.

I attached a small demo project. Are there any ideas to solve the problems?

Kind Regards
Edgar

Re: TFastLineSeries AutoRepaint Problems

Posted: Fri Aug 12, 2016 12:29 pm
by 10050769
Hello Edgar,

Firstly, I recommend you don't disable AutoRepaint, so seems the chart draw is incorrect. Then I would like suggest you follow the below indications:

Note that drawing millions of points in a regular screen means that many points will be drawn in the same pixel.
That's why we implemented solutions like those you've found and some others:

DrawAllPoints property. See the example at "All features\Welcome !\Speed\Fast Line Speed DrawAll".
TDownSampling function to reduce the number of points to draw. See the example at "All features\Welcome !\Functions\Extended\Reducing number of points".
Set the TFastLineSeries DrawStyle property to flAll. This makes the whole series to be drawn at once instead of drawing it segment per segment.
Non solid lines are very slow compared to solid lines. So make sure your series and axes Pen.Style are set to psSolid.
Disable AntiAlias. This can be done in two ways:
- At Chart level:

Code: Select all

(Chart1.Canvas as TGDIPlusCanvas).AntiAlias:=False;
- At FastLine series level:

Code: Select all

Series1.FastPen := True;
Implement as tips as possible from the ones explained in the Real-time Charting article here.
Speed Theme. See the example at "All features\Welcome !\Speed\Fast Line Speed DrawAll".
Generally avoid drawing as many decoration elements as possible, specially gradients and texts. You can avoid drawing some axis labels setting bigger axis Increments.

The mentioned examples and other ones can be found in the features demo program shipped with the installation.

Hoping this helps you
Thanks in advance

Re: TFastLineSeries AutoRepaint Problems

Posted: Thu Aug 18, 2016 9:35 am
by 16478747
Hello Sandra,

Thank you for your info.

Setting the chart AntiAlias = false worked for me as a workaround for the FastPen color problem.

I know, setting AutoRepaint = true solves the problem. But AutoRepaint = false reduces the CPU utilization a lot in my application.
There is no significant speed reduction for many seconds. Therefor I would like to use this feature.

For me this seems to be a bug in TeeChart only when painting vertical lines.

This picture shows the error:
TeeChartError.png
TeeChartError.png (16.72 KiB) Viewed 14001 times
After chart repaint with mouse unzoom:
TeeChartOk.png
TeeChartOk.png (16.63 KiB) Viewed 13994 times
Is there a chance, that this bug is fixed in the next release?

Kind Regards
Edgar

Re: TFastLineSeries AutoRepaint Problems

Posted: Fri Aug 19, 2016 3:56 pm
by 10050769
Hello Edgar,

I have added the request in TeeChart VCL/FMX Bugzilla tracker to consider fix it to upcoming versions. Here’s the link: http://bugs.teechart.net/show_bug.cgi?id=1604

Feel free to add your mail to the CC list of the other tickets to be automatically notified when they'll be updated.

Thanks in advance

Re: TFastLineSeries AutoRepaint Problems

Posted: Wed Aug 24, 2016 10:48 am
by 16478747
Hello Sandra,

Thank you for your help. But I only see the clipping bug in your Bugzilla request.

I don't see the bug with the missing vertical lines (see pictures above) with TFastLineSeries properties:

AutoRepaint = false
DrawAllPoints = false
DrawAllPointsStyle = daMinMax

Kind Regards
Edgar

Re: TFastLineSeries AutoRepaint Problems

Posted: Thu Aug 25, 2016 10:27 am
by yeray
Hello Edgar,
pet wrote:2. Problem
If I set FastPen = true, the color of the series is wrong.
A chart repaint corrects the problem.
I'm afraid FastPen doesn't work with GDIPlus.
Take a look at the options you have to change from GDIPlus to GDI here.
pet wrote:3. Problem
Some of the series values are not shown in the chart. This error only appears, if AutoRepaint = false AND DrawAllPoints = false.
A chart repaint corrects the problem.
I see. I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1609

Re: TFastLineSeries AutoRepaint Problems

Posted: Thu Aug 25, 2016 3:23 pm
by 16478747
Hello Yeray,

Thank you for your help.

Kind Regards
Edgar

Re: TFastLineSeries AutoRepaint Problems

Posted: Fri Aug 26, 2016 7:28 am
by yeray
Hello Edgar,
Yeray wrote:
pet wrote:3. Problem
Some of the series values are not shown in the chart. This error only appears, if AutoRepaint = false AND DrawAllPoints = false.
A chart repaint corrects the problem.
I see. I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1609
This is just to let you know we've just fixed the problem and closed the ticket so the next maintenance update should include it.