How to make an X-Y chart ?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Marck
Newbie
Newbie
Posts: 6
Joined: Fri Dec 13, 2002 5:00 am
Location: Netherlands

How to make an X-Y chart ?

Post by Marck » Tue Sep 27, 2005 12:20 pm

Hi,

I would like to have a graph, having 2 axis (x and y) both ranging from -60 to +60.

Next I would like to add a number of values (for instance, x=12 y=30).

How do I do that? (I'm not like new with tchart, but this one really puzzles me)

Code I tried (after dumping a TChart component on a form):

Code: Select all

Procedure TForm1.Button1Click( Sender as TObject);
var
  A: TChartSeries;
begin
  A := TChartSeries.Create( Self);
  A.AddXY( -60, -60, '', clBlack);
  A.AddXY( 40, 60);
  A.AddXY( -60, 30);
  A.AddXY( 30, -30);
  // and so on
  Chart1.AddSeries( A);
Although a legend shows up, not one single point is drawn......

What am I missing ?

Marck
Newbie
Newbie
Posts: 6
Joined: Fri Dec 13, 2002 5:00 am
Location: Netherlands

Post by Marck » Tue Sep 27, 2005 12:46 pm

Never mind, already found it.....

Code: Select all

var
  A: TPointSeries;

Post Reply