TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
Friis
- Newbie
- Posts: 11
- Joined: Mon Apr 11, 2011 12:00 am
Post
by Friis » Sun Jan 01, 2012 7:38 pm
Hi,
I'm using a OnClickSeries on a GanttSeries.
How do I obtain the MarkText when I click on a TGantt series?
I have tried the following but it doesn't work:
Code: Select all
procedure TForm1.Chart14ClickSeries(Sender: TCustomChart; Series: TChartSeries;
ValueIndex: Integer; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
GanttSeries : TGanttSeries;
begin
if Series is TGanttSeries then
begin
GanttSeries := Series as TGanttSeries;
showmessage(GanttSeries.Marks.Item[valueindex].Text[0]);
end;
-
Yeray
- Site Admin
- Posts: 9612
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Wed Jan 04, 2012 9:17 am
Hi Friis,
If in the Marks you are showing the Labels, you can simply show the Labels in the click event:
Code: Select all
ShowMessage(GanttSeries.Labels[ValueIndex]);
If you are using a different Marks Style, you'll have to format your string manually, but knowing the ValueIndex of the point, it shouldn't be difficult. Anyway, if you find any problem with it, don't hesitate to let us know.