I have the code
var
myrig:tchartshape;
then..
myrig:=Tchartshape.Create(chart);
chart.AddSeries(myrig);
myrig.Title:='Myrig';
Myrig.ShowInLegend := True;
Myrig.Marks.Visible := true;
myrig.SeriesColor:=clred;
myrig.XValues[0]:=X1;
myrig.XValues[0]:=Y1;
myrig.Style:=chasCircle;
this creates the object and adds it to my chart legend okay, but I can't find hw to draw the object on the chart. I want to draw the object as a circle at point X, Y with a given radius.
How do I do this please?
cheers
Sean
Adding a Shape in code
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Sean,
You could do something like:
According to TeeChart help and referring to X0,Y0, X1 and Y1:
These properties define the Top - Left and Bottom - Right coordinates of the englobing TChartShape rectangle.
The values should be expressed in Axis coordinates.
You can convert from Screen pixel coordinates to values and vice-versa using several TChart and TChartSeries methods like XScreenToValue and YScreenToValue.
You could do something like:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
myrig:tchartshape;
begin
myrig:=Tchartshape.Create(self);
chart1.AddSeries(myrig);
myrig.Title:='Myrig';
Myrig.ShowInLegend := True;
Myrig.Marks.Visible := true;
myrig.SeriesColor:=clred;
myrig.X0:=10;
myrig.Y0:=10;
myrig.X1:=0;
myrig.Y1:=20;
myrig.Style:=chasCircle;
end;
These properties define the Top - Left and Bottom - Right coordinates of the englobing TChartShape rectangle.
The values should be expressed in Axis coordinates.
You can convert from Screen pixel coordinates to values and vice-versa using several TChart and TChartSeries methods like XScreenToValue and YScreenToValue.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |