Active Series

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
McMClark
Newbie
Newbie
Posts: 50
Joined: Thu Apr 15, 2004 4:00 am

Active Series

Post by McMClark » Thu Mar 27, 2008 3:13 pm

I am using Delphi VCL with TeeChart 7. At runtime, I need to know if a user has clicked a series off from the DBChart Legend. How can I get the information? Is the list of active series kept in a collection that I can access?

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

Post by Narcís » Thu Mar 27, 2008 3:50 pm

Hi McMClark,

Yes, you can use OnClickLegend event like this:

Code: Select all

procedure TForm1.DBChart1ClickLegend(Sender: TCustomChart;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var SeriesIndex: Integer;
begin
  SeriesIndex := DBChart1.Legend.Clicked(X,Y);

  if SeriesIndex <> -1 then
    DBChart1.Title.Text[0] := 'Series ' + IntToStr(SeriesIndex) + ' selected'
  else
    DBChart1.Title.Text[0] := 'No series selected';
end;
Hope this helps!
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