Page 1 of 1

Question regarding TLineSeries and TAntiAliasTool

Posted: Wed Sep 05, 2012 1:31 pm
by 9232649
Hi All,

Im creating a chart with TLineSeries and I wanted to use the TAntiaAliasTool to smooth the lines. During this design phase I have just added a couple of TLineSeries, and selected tool>AntiAlias in the charteditor. But no matter which size i set on the border width, the lines come out in the same width, which is a little to thin for my intentions. Anyway aroud this? Is this the intended effect for this tool?

Best Regards,

Johan Ingemansson

Re: Question regarding TLineSeries and TAntiAliasTool

Posted: Thu Sep 06, 2012 8:02 am
by yeray
Hi Johan,

I'm not able to reproduce the problem; the code below seems to draw both lines with the pen width set.

Code: Select all

uses Series, TeeAntiAlias;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.Tools.Add(TAntiAliasTool.Create(Self));

  Chart1.View3D:=false;

  for i:=0 to 1 do
    with Chart1.AddSeries(TLineSeries) do
    begin
      FillSampleValues;
      Pen.Width:=2;
    end;
end;
Anyway, I'd sugges you to give it a try to the GDI+ canvas, that also does an antialias:

Code: Select all

uses Series, TeeGDIPlus;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.Canvas:=TGDIPlusCanvas.Create;

  Chart1.View3D:=false;

  for i:=0 to 1 do
    with Chart1.AddSeries(TLineSeries) do
    begin
      FillSampleValues;
      Pen.Width:=2;
    end;
end;