Page 1 of 1

TeeChart / Intraweb / Onclick

Posted: Thu Mar 22, 2007 4:53 am
by 9341569
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

Posted: Thu Mar 22, 2007 9:17 am
by yeray
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;