Hi all,
I'm currently trying to use the event OnClickSeries() from TChart for a TPointSeries.
Unfortunately, the click event is not always sent.
Marks are enabled in my series. If I click on the mark text or within the marks background, the event is not fired.
Is this the desired behaviour ?
What can I do, to always get the click event if I click on a series item ?
And what is the effect of "ClickTolerance" being "0" or "30"....
Best regards
Christian
Chart OnClickSeries not working as expected
-
- Newbie
- Posts: 1
- Joined: Fri Mar 17, 2017 12:00 am
Re: Chart OnClickSeries not working as expected
Hello,
You could use the Clicked function at the OnClick event to see if the Marks have been clicked. Ie:
You could use the Clicked function at the OnClick event to see if the Marks have been clicked. Ie:
Code: Select all
procedure TForm1.Chart1Click(Sender: TObject);
var ValueIndex: Integer;
MousePos: TPoint;
begin
MousePos:=Chart1.GetCursorPos;
ValueIndex:=Series1.Marks.Clicked(MousePos.X, MousePos.Y);
if ValueIndex>-1 then
ShowMessage('Mark clicked: ' + IntToStr(ValueIndex));
end;
procedure TForm1.Chart1ClickSeries(Sender: TCustomChart; Series: TChartSeries;
ValueIndex: Integer; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ShowMessage('Point Clicked: ' + IntToStr(ValueIndex));
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |