Getting the name of a Slice in a Pie Chart
Posted: Sat Mar 04, 2017 7:14 pm
I am brand new to Tee Chart so first, i appologise for my terms in this question.
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.
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.
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;