Hi,
Is there a way to set TChart OnClickSeries mouse margin? I'm using the OnClickSeries event, but the mouse has to be right on the Series to receive the event. I'd like to change this so it is easier to click on a series.
Thanks
-Bill
Series On click margin
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Bill,
You can achieve what you request doing something like this:
You can achieve what you request doing something like this:
Code: Select all
procedure TForm1.Chart1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var i, j, tolerance: Integer;
p, l0, l1: TPoint;
begin
tolerance := 10;
p.X := X;
p.Y := Y;
for i:=0 to Chart1.SeriesCount-1 do
begin
for j:=1 to Chart1[i].Count-1 do
begin
l0.X := Chart1[i].CalcXPos(j-1);
l0.Y := Chart1[i].CalcYPos(j-1);
l1.X := Chart1[i].CalcXPos(j-1);
l1.Y := Chart1[i].CalcYPos(j-1);
if PointInLine(p, l0, l1, tolerance) then
begin
Chart1.Title.Text[0] := 'Series' + IntToStr(i+1) + 'clicked at point ' + IntToStr(j);
break;
end;
end;
end;
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi BE,
I'm afraid there's not such an option. Acutally, the PointInLine method I suggested is a TeeChart method, not Delphi's. TeeChart uses series's Clicked method for determining if they are being clicked or not.
I'm afraid there's not such an option. Acutally, the PointInLine method I suggested is a TeeChart method, not Delphi's. TeeChart uses series's Clicked method for determining if they are being clicked or not.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Series On click margin
Hello,
I was just wondering if you have introduced a Tolerance parameters for seriesClick in version 8 of TeeChart, or if I should still use the same function shown above ?
Thank you !
I was just wondering if you have introduced a Tolerance parameters for seriesClick in version 8 of TeeChart, or if I should still use the same function shown above ?
Thank you !
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Series On click margin
Hi bertrod,
I don't think this (TV52014661) has been implemented in v8. You can what has been implemented recently in the release notes.
I don't think this (TV52014661) has been implemented in v8. You can what has been implemented recently in the release notes.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |