Page 1 of 1

Group Slices getting values

Posted: Wed Mar 23, 2016 5:15 pm
by 17573882
Hi,

I have some Pie Charts (TDBChart) where I have grouped slices where the values are less than 5%.

The chart displays just fine, but I want to be able to quickly get the 'X' values for the grouped slice, if the user clicks on the grouped slice. For the non-grouped slices, I get the clicked slice X value using Series.Labels[ValueIndex] in an OnClickSeries event. Obviously if I click on the grouped slice, this approach just gives me the 'Grouped Slices' 'Label' value.

I need the X values for building subsequent SQL statements.

Is there a simple way to get the X values that have been grouped?

Thanks
Clive

Re: Group Slices getting values

Posted: Tue Mar 29, 2016 11:52 am
by narcis
Hi Clive,

The code snippet below returns the number of one last additional slice containing all grouped slices. So this is not possible for now. I have added your request to the wish-list to be considered for inclusion in future releases: http://bugs.teechart.net/show_bug.cgi?id=1480

Code: Select all

procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var Index: Integer;
begin
  Index:=Series1.Clicked(X,Y);

  if Index <> -1 then
    Chart1.Title.Text[0] := IntToStr(Index);
end;