TFastLineSeries AutoRepaint Problems

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
pet
Newbie
Newbie
Posts: 4
Joined: Fri Jul 15, 2016 12:00 am
Contact:

TFastLineSeries AutoRepaint Problems

Post by pet » Thu Aug 11, 2016 3:33 pm

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
Attachments
TeeChartSpeed2.zip
(50.04 KiB) Downloaded 596 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: TFastLineSeries AutoRepaint Problems

Post by Sandra » Fri Aug 12, 2016 12:29 pm

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
Best Regards,
Sandra Pazos / 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

pet
Newbie
Newbie
Posts: 4
Joined: Fri Jul 15, 2016 12:00 am
Contact:

Re: TFastLineSeries AutoRepaint Problems

Post by pet » Thu Aug 18, 2016 9:35 am

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 12688 times
After chart repaint with mouse unzoom:
TeeChartOk.png
TeeChartOk.png (16.63 KiB) Viewed 12681 times
Is there a chance, that this bug is fixed in the next release?

Kind Regards
Edgar

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: TFastLineSeries AutoRepaint Problems

Post by Sandra » Fri Aug 19, 2016 3:56 pm

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
Best Regards,
Sandra Pazos / 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

pet
Newbie
Newbie
Posts: 4
Joined: Fri Jul 15, 2016 12:00 am
Contact:

Re: TFastLineSeries AutoRepaint Problems

Post by pet » Wed Aug 24, 2016 10:48 am

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

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TFastLineSeries AutoRepaint Problems

Post by Yeray » Thu Aug 25, 2016 10:27 am

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
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

pet
Newbie
Newbie
Posts: 4
Joined: Fri Jul 15, 2016 12:00 am
Contact:

Re: TFastLineSeries AutoRepaint Problems

Post by pet » Thu Aug 25, 2016 3:23 pm

Hello Yeray,

Thank you for your help.

Kind Regards
Edgar

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TFastLineSeries AutoRepaint Problems

Post by Yeray » Fri Aug 26, 2016 7:28 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply