Group Slices getting values

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
CVP99
Newbie
Newbie
Posts: 4
Joined: Tue Jun 09, 2015 12:00 am

Group Slices getting values

Post by CVP99 » Wed Mar 23, 2016 5:15 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Group Slices getting values

Post by Narcís » Tue Mar 29, 2016 11:52 am

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;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply