Improve refresh

Hello,

I have been using TeeChart for a long time but I am dealing with a slow display problem when I want to display a 2 millions points serie.

By reading documentations, I am using a TFastLineSeries serie with some particular options in order to speed up display:

      DrawAllPoints:= False ;
      DrawAllPointsStyle:= daMinMax ;
      FastPen:= False ;
      AutoRepaint:= False ;

I also tried to set Min/Max before adding data to serie but it didn’t improve display.

The display is very slow while the filling of the serie is fast.

Here is the link of my project with datas to display:
https://drive.google.com/open?id=1z_0AU9TQAQkZC1Xjjd3yC44yodkAj12U

Does someone has an idea or some tips to improve display ?

Regards

Hello,

I’ve added a couple of extra columns to check the drawing speed and the number of values in the series:

var tmpDraw: Int64 ;

procedure TForm1.va(Sender: TObject);
begin
  tmpDraw:= GetTickCount64 ;
end;

procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
  StringGrid1.Cells[2, StringGrid1.RowCount-2]:= IntToStr(GetTickCount64 - tmpDraw) ;
end;

procedure TForm1.ListBox1HddDblClick(Sender: TObject);
//...
  StringGrid1.Cells[2,0]:= 'Chart draw' ;
  StringGrid1.Cells[3,0]:= 'Points' ;
  //...
    StringGrid1.Cells[3, StringGrid1.RowCount-1]:= IntToStr(k) ;
  //...

Here the results I get:

Another alternative is to use the TSmoothingFunction, which takes some time to calculate, but improves the drawing speed with a result more similar to the original series:

    DownSampleSerie := TFastLineSeries.Create(Nil) ;
    with DownSampleSerie do
    begin
      ParentChart:= Chart1 ;
      Color:=IntensiteSerie.Color;

      DownSampleFun := TDownSamplingFunction.Create(nil);
      SetFunction(DownSampleFun);

      DownSampleFun.Tolerance := 4;
      DownSampleFun.DownSampleMethod := dsAverage;

      DataSource := IntensiteSerie;
    end;