lael for a series

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
seanmurphy
Newbie
Newbie
Posts: 48
Joined: Fri Mar 12, 2004 5:00 am

lael for a series

Post by seanmurphy » Fri Sep 02, 2005 3:36 pm

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

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 Sep 02, 2005 4:17 pm

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:

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;
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.
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

seanmurphy
Newbie
Newbie
Posts: 48
Joined: Fri Mar 12, 2004 5:00 am

Post by seanmurphy » Sat Sep 03, 2005 9:26 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

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

Post by Narcís » Mon Sep 05, 2005 7:18 am

Hi Sean,

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
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply