I am trying to return the name of a Slice of a Pie chart or a Bar Chart when a customer double clicks it. I want to use this name to edit my SQL to show a new chart based on the name of the slice double clicked. I use the following code to return the Series and Point on the chart, but I need a way of converting the point to a name. I know this must be a very basic question but didn't find an answer by searching.
I hope this makes sense. Thanks.
Code: Select all
procedure TMainForm.DBChart1DblClick(Sender: TObject); var t,tmp : Integer; x,y : Double; begin Series1.GetCursorValues(x,y); for t:=0 to DBChart1.SeriesCount-1 do begin tmp:=DBChart1.Series[t].GetCursorValueIndex; if tmp<>-1 then ShowMessage(' Clicked Series: '+DBChart1.Series[t].Name+' at point: '+inttostr(tmp)); end;