I have a chart which draws multiple tlineseries, I would like to put a label on the chart against each lineseries, drawn next to either the first or last x,y point of the lineseries. Can someone point me in the right direction to do this please.
thanks
Sean
lael for a series
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Sean,
You have several options for doing that:
1) Using custom labels. You can make both vertical axes visible using one for your custom labels and the other one for the series values labels:
For more information on custom labels please have a look at the TeeChart features demo, available at the TeeChart program group, and search for custom labels.
2) Using annotation tools. For more information on how to use them please have a look at All Features\Welcome!\Tools\Annotation example at the TeeChart features demo.
3) Custom drawing on TChart's canvas. For more information on how to custom draw on TChart please have a look at the TeeChart tutorials at the "Documentation" folder at the TeeChart program group.
You have several options for doing that:
1) Using custom labels. You can make both vertical axes visible using one for your custom labels and the other one for the series values labels:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
for i:=0 to Chart1.SeriesCount-1 do
With Chart1[i] do
begin
FillSampleValues();
VertAxis:=aBothVertAxis;
Chart1.Axes.Right.Items.Add(YValue[Count-1],'Series'+IntToStr(i));
end;
Chart1.Axes.Right.Grid.Visible:=false;
end;
2) Using annotation tools. For more information on how to use them please have a look at All Features\Welcome!\Tools\Annotation example at the TeeChart features demo.
3) Custom drawing on TChart's canvas. For more information on how to custom draw on TChart please have a look at the TeeChart tutorials at the "Documentation" folder at the TeeChart program group.
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 |
-
- Newbie
- Posts: 48
- Joined: Fri Mar 12, 2004 5:00 am
thanks Narcis,
I can get some of that to work with annotation tools, but am now struggling with creating an annotation tools in code, could you help me with this please....
mytool:array[1..20] of TAnnotationTool;
for i:=1 to X do
begin
mytool:=TAnnotationTool.Create(self);
chart.Add ???(mytool) <<<
end;
its the chart.add??? line I can't find a method for, I use similar to create series and add to a chart at run time, but need something to do the same job for the annotation tool.
thanks,
Sean
I can get some of that to work with annotation tools, but am now struggling with creating an annotation tools in code, could you help me with this please....
mytool:array[1..20] of TAnnotationTool;
for i:=1 to X do
begin
mytool:=TAnnotationTool.Create(self);
chart.Add ???(mytool) <<<
end;
its the chart.add??? line I can't find a method for, I use similar to create series and add to a chart at run time, but need something to do the same job for the annotation tool.
thanks,
Sean
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Sean,
Yes, you need to use ParentChart property:
Yes, you need to use ParentChart property:
Code: Select all
for i:=1 to X do
begin
mytool[i]:=TAnnotationTool.Create(self);
mytool[i].ParentChart:=Chart1;
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 |
Instructions - How to post in this forum |