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 .
DblClick TseriesMarks
Hi,
to get the MarkText of the double clicked Mark you can use similar code to the following :
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).
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;
Pep Jorge
http://support.steema.com
http://support.steema.com
Many thanks
Works like a charm
Thank you very much, Pep
Thank you very much, Pep