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
TFastLineSeries AutoRepaint Problems
TFastLineSeries AutoRepaint Problems
- Attachments
-
- TeeChartSpeed2.zip
- (50.04 KiB) Downloaded 815 times
Re: TFastLineSeries AutoRepaint Problems
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:
- At FastLine series level:
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
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;
Code: Select all
Series1.FastPen := True;
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 |
Instructions - How to post in this forum |
Re: TFastLineSeries AutoRepaint Problems
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: After chart repaint with mouse unzoom: Is there a chance, that this bug is fixed in the next release?
Kind Regards
Edgar
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: After chart repaint with mouse unzoom: Is there a chance, that this bug is fixed in the next release?
Kind Regards
Edgar
Re: TFastLineSeries AutoRepaint Problems
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
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 |
Instructions - How to post in this forum |
Re: TFastLineSeries AutoRepaint Problems
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
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
Hello Edgar,
Take a look at the options you have to change from GDIPlus to GDI here.
http://bugs.teechart.net/show_bug.cgi?id=1609
I'm afraid FastPen doesn't work with GDIPlus.pet wrote:2. Problem
If I set FastPen = true, the color of the series is wrong.
A chart repaint corrects the problem.
Take a look at the options you have to change from GDIPlus to GDI here.
I see. I've added it to the public tracker: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.
http://bugs.teechart.net/show_bug.cgi?id=1609
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TFastLineSeries AutoRepaint Problems
Hello Yeray,
Thank you for your help.
Kind Regards
Edgar
Thank you for your help.
Kind Regards
Edgar
Re: TFastLineSeries AutoRepaint Problems
Hello Edgar,
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.Yeray wrote:I see. I've added it to the public tracker: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.
http://bugs.teechart.net/show_bug.cgi?id=1609
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |