Question regarding TLineSeries and TAntiAliasTool

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Question regarding TLineSeries and TAntiAliasTool

Post by Johan Ingemansson » Wed Sep 05, 2012 1:31 pm

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

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

Re: Question regarding TLineSeries and TAntiAliasTool

Post by Yeray » Thu Sep 06, 2012 8:02 am

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;
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