TPieSeries OnClick not working
Posted: Thu Sep 27, 2012 6:41 am
My application charts a dataset and allows the user to choose the chart type from a list; bar, area, line and pie. They can double-click any of the series to see the data in another form. The bar, area and line charts work just fine. The pie one doesn't and it seems that the 'OnClickSeries' event doesn't fire. This 100% definitely used to work in an older version of TChart, but the current (v2112.06.120613) version does not.
I have tried setting the Series.OnClick instead (as per below code) of the Chart.OnClickSeries and it makes no difference - the procedure is never fired.
Any suggestions/solutions gratefully received.
Code snippet;
I have tried setting the Series.OnClick instead (as per below code) of the Chart.OnClickSeries and it makes no difference - the procedure is never fired.
Any suggestions/solutions gratefully received.
Code snippet;
Code: Select all
// When creating the chart
for fnl := 0 to MyChart.SeriesCount-1 do
MyChart.Series[fnl].OnClick := ChartSeriesClick;
// Series OnClick.
procedure MyForm.ChartSeriesClick(Sender: TChartSeries; ValueIndex: Integer; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if Sender is TPieSeries then
ClickValueVariable := Sender.ValueMarkText[ValueIndex]
else
ClickValueVariable := Sender.Title;
end;