Lines are jagged

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
mSchenkel
Newbie
Newbie
Posts: 8
Joined: Fri Feb 08, 2008 12:00 am

Lines are jagged

Post by mSchenkel » Thu Jun 10, 2010 2:13 pm

I am finding it difficult to create a line graph with nice smooth lines between points. For example, in the TChart below I consider the lines to be very "jagged":
jaggedlines.JPG
jaggedlines.JPG (18.55 KiB) Viewed 2916 times
Below is a graph I found off another website:
goodgraph.JPG
goodgraph.JPG (11.07 KiB) Viewed 2915 times
(see it for real: http://www.maani.us/xml_charts/index.ph ... bmenu=Line )

I just can't seem to create charts which have nice smooth lines. It seems a lot of other graphic solutions are rendering charts with much greater eye appeal.

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

Re: Lines are jagged

Post by Yeray » Fri Jun 11, 2010 1:06 pm

Hi mSchenkel,

You could use AntiAlias to get nicer smoothed lines:
chart.png
chart.png (33.8 KiB) Viewed 2890 times

Code: Select all

uses Series, TeeAntialias, TeeThemes;

procedure TForm1.FormCreate(Sender: TObject);
var AntiAliasCanvas: TAntiAliasCanvas;
    i: Integer;
begin
  Chart1.View3D:=false;

  AntiAliasCanvas:=TAntiAliasCanvas.Create;
  Chart1.Canvas:=AntiAliasCanvas;

  ApplyChartTheme(TBlackIsBackTheme, Chart1);

  for i:=0 to 1 do
  with Chart1.AddSeries(TFastLineSeries) as TFastLineSeries do
  begin
    Pen.Width:=2;
    FillSampleValues;
  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