Current using BDS2006,
When i apply 2 pie series with (Concentric), Series1 and Series2, I have handled OnClick event for both series but only Series2(Outer Pie) OnClick will be triggered. I have tried to handle TChart.OnClickSeries, but regardless of which series I am clicking, in OnClickSeries event, the sender is always Series2(Outer Pie). Any idea on how can I handle OnClick event for both Pies?
Thanks
Multiple Pies (Concentric) mouse click not function
Re: Multiple Pies (Concentric) mouse click not function
Hello,
You could use OnMouseDown event and call the clicked function of both series in it. Ie:
You could use OnMouseDown event and call the clicked function of both series in it. Ie:
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
var i:Integer;
begin
Chart1.View3D:=false;
Chart1.Hover.Visible:=false;
for i:=0 to 1 do
with Chart1.AddSeries(TPieSeries) as TPieSeries do
begin
MultiPie:=mpConcentric;
FillSampleValues();
end;
Chart1.OnMouseDown:=ChartMouseDown;
Memo1.Clear;
end;
procedure TForm1.ChartMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState;
X, Y: Integer);
var SeriesIndex,
ValueIndex: Integer;
begin
for SeriesIndex:=0 to Chart1.SeriesCount-1 do
begin
ValueIndex:=Chart1[SeriesIndex].Clicked(X,Y);
if ValueIndex>-1 then
Memo1.Lines.Add('OnMouseDown event, '+SeriesTitleOrName(Chart1[SeriesIndex])+', ValueIndex: '+IntToStr(ValueIndex));
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |