TeeChart / Intraweb / Onclick

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
drueter
Newbie
Newbie
Posts: 1
Joined: Wed Apr 06, 2005 4:00 am

TeeChart / Intraweb / Onclick

Post by drueter » Thu Mar 22, 2007 4:53 am

I am using TeeChart Pro 7.09 (BDS2006) with Intraweb 8 (via TIWChart), and rendering a pie chart.

I would like to handle an OnClick event and determine which slice was clicked.

It looks like the TIWChart.OnMouseDown gives me the screen X and Y.

How can I figure out which slice (i.e. which series value index) corresponds to this screen XY?

Thanks in advance.

David Rueter
drueter@assyst.com

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu Mar 22, 2007 9:17 am

Hello drueter,
You can use OnClick event as follows:

Code: Select all

procedure TForm1.Series1Click(Sender: TChartSeries; ValueIndex: Integer;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  Chart1.Title.Caption := 'Clicked Pie: ' + inttostr(Series1.CalcClickedPie(X,Y));
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply