How to get Legend Text

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Command Alkon
Newbie
Newbie
Posts: 12
Joined: Thu Oct 28, 2004 4:00 am

How to get Legend Text

Post by Command Alkon » Tue Jun 21, 2005 6:23 am

Hi,

I have a normal line series chart with couple of line series displayed. I also have legend visible for each series.

I am assigning the following procedure to Chart's OnClickSeries event

Code: Select all

procedure DoOnClickSeries(Sender: TCustomChart; Series: TChartSeries; ValueIndex: Integer; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); 
So whenever someone clicks on the series I want to show the legend text of that series

Is this possible..? Please help.

Thanks :)
Last edited by Command Alkon on Tue Jun 21, 2005 9:20 pm, edited 1 time in total.

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

Post by Narcís » Tue Jun 21, 2005 7:29 am

Hi Command Alkon,

Yes, you can do something like:

Code: Select all

  if Series.Title='' then Caption:=Series.Name
  else Caption:=Series.Title;
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

Command Alkon
Newbie
Newbie
Posts: 12
Joined: Thu Oct 28, 2004 4:00 am

Post by Command Alkon » Tue Jun 21, 2005 9:22 pm

Thank a lot. You da man.

BTW Series.Name gave me nothing while Series.Title gives me what I want.

Cheers again :)

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

Post by Narcís » Wed Jun 22, 2005 7:09 am

Hi,

You're welcome. I'm glad to hear this solved your problem.
BTW Series.Name gave me nothing while Series.Title gives me what I want.
Yes, this will depend on if you give your series a name or not. That's why I included both options.
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