How to use TCanvas3D object to paint marks(point,line...)

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
wwp3321
Newbie
Newbie
Posts: 60
Joined: Wed Jul 02, 2003 4:00 am

How to use TCanvas3D object to paint marks(point,line...)

Post by wwp3321 » Fri Nov 14, 2008 5:58 am

How to use TCanvas3D object to paint marks(point,line...) at any position
of Chart? For Example,I want to paint a line from P0(0,0) to P1(10,50).

TCanvas3D * cTest;
cTest = Chart1->Canvas;
.......


Regards
wwp3321

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Nov 14, 2008 8:55 am

Hi wwp3321,

This is much easier, you can do something like this in the OnAfterDraw event:

Code: Select all

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var X0, Y0, X1, Y1: Integer;
begin
  X0:=Chart1.Axes.Bottom.CalcXPosValue(0);
  Y0:=Chart1.Axes.Left.CalcYPosValue(0);
  X1:=Chart1.Axes.Bottom.CalcXPosValue(10);
  Y1:=Chart1.Axes.Left.CalcYPosValue(50);
  Chart1.Canvas.Pen.Color:=clRed;
  Chart1.Canvas.Pen.Width:=3;
  Chart1.Canvas.Line(X0,Y0,X1,Y1);
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

wwp3321
Newbie
Newbie
Posts: 60
Joined: Wed Jul 02, 2003 4:00 am

Post by wwp3321 » Fri Nov 14, 2008 11:25 am

Thank you ! :D

Post Reply