TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
Atheling
- Newbie

- Posts: 4
- Joined: Thu Jan 09, 2003 5:00 am
Post
by Atheling » Fri May 26, 2006 6:12 am
I'd like to open a form after double clicking on a series mark of any series in a multi-series chart. The MarkText determines the content of the edit box on the form. Clicking the mark does not give me access to the MarkText. Only the index is returned using the clicked method of TSeriesMarks, which doesn't help much if I can not determine which series the mark belongs to. Do I have to click the series below the mark to obtain the Marktext?
I'm definitely missing something somewhere. I'd be most grateful for any advice

.
-
Pep
- Site Admin

- Posts: 3313
- Joined: Fri Nov 14, 2003 5:00 am
-
Contact:
Post
by Pep » Tue May 30, 2006 2:57 pm
Hi,
to get the MarkText of the double clicked Mark you can use similar code to the following :
Code: Select all
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var tmpL : Integer;
begin
if dblclick then
begin
tmpL := Chart1.Series[0].Marks.Clicked(X,Y);
If (tmpL <> -1) Then
showmessage(Chart1.Series[0].Labels[tmpl]);
dblclick := false;
Abort;
end;
end;
procedure TForm1.Chart1DblClick(Sender: TObject);
begin
dblclick := true;
end;
Of course, if you have more than one Series you must iterate through all the Series checking is one of its points has been clicked (just checking one Series in the sample I posted above).
-
Atheling
- Newbie

- Posts: 4
- Joined: Thu Jan 09, 2003 5:00 am
Post
by Atheling » Wed May 31, 2006 8:51 pm
Works like a charm
Thank you very much, Pep
