Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2424

Summary: Painting is 15 times slower with this option enabled
Product: VCL TeeChart Reporter: alex <ushastik-007>
Component: ChartAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED NOTABUG    
Severity: normal CC: yeray
Priority: ---    
Version: 17.160426   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Attachments: painting time ms x10

Description alex 2021-05-13 03:13:27 EDT
Created attachment 962 [details]
painting time ms x10

Hi! Is there something special about SmallDots pen style? Cause it makes TChart 15 times slower. 

These are the requirements:

Axis.Grid.SmallDots must be enabled.
The renderer must be GDI+
The anti-aliasing must be enabled, that's important.

Also:

Delphi 10.4, 32 bit Windows compiler.
TChart 17.160129 (the default included)
Windows 7.

And the code:

procedure TForm1.Button_test_Click(Sender: TObject);
begin
 chart1.Series[0].FillSampleValues(10);  // TPointSeries
 t:=gettickcount;
 for var i:= 1 to 10 do chart1.Repaint;
 caption:=(GetTickCount - t).ToString;
end;

procedure TForm1.Button_MakeItSlow_Click(Sender: TObject);
begin
 chart1.LeftAxis.Grid.SmallDots:=true;
 chart1.BottomAxis.Grid.SmallDots:=true;
end;

Make TChart big enough to see the slowdown. In my case it's fullscreen and normally the painting process takes 10 ms. With SmallDots it's 150 ms.
Comment 1 yeray alonso 2021-05-13 03:58:06 EDT
Non solid lines are very slow in GDI+ (and also GDI) compared to solid lines.

We recommend using TFastLineSeries for intensive drawing, which includes features to improve the drawing performance.

- DrawStyle property set to flAll

  Series1.DrawStyle := flAll;
  Series1.Pen.Style:=psSolid;

- You might also try disabling AntiAlias. This can be done in two ways:

1) At Chart level:

  (Chart1.Canvas as TGDIPlusCanvas).AntiAlias:=False;

2) At FastLine series level:

  Series1.FastPen := True;

- You can also use DrawAllPointsStyle daMinMax:

  Series1.DrawAllPoints:=false;
  Series1.DrawAllPointsStyle:=daMinMax
Comment 2 alex 2021-05-13 05:20:12 EDT
Good to hear you're aware. By the way, is there a TFastPoint series? Like FastLine, but with points?
Comment 3 yeray alonso 2021-05-13 05:22:10 EDT
No, I'm afraid there's no TFastPointSeries:
http://bugs.steema.com/show_bug.cgi?id=1746