In the past I had used something like hit test to find the sub part of the chart under the cursor but have forgotton the exact details.
Also am not able to find any thing related to it in latest demo/examples etc. I am using TeeChart pro 7.07
Kindly help.
Regards
using hit test on TeeChart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Corey,
Sorry but I don't understand what are you exactly trying to achieve here. Could you please give us more detailed information on what are you trying to get?
Thanks in advance.
Sorry but I don't understand what are you exactly trying to achieve here. Could you please give us more detailed information on what are you trying to get?
Thanks in advance.
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 |
-
- Newbie
- Posts: 8
- Joined: Fri Sep 02, 2005 4:00 am
trying to find region under mouse
Dear Narcís
Thanks for your kind reply.
Actually, I ws trying to get around another problem (TeeLineSeparator not working in displayed Series Titles in the graph).
I was thinking that if I can track the mouse cursor then atleast I can pop up some sort of hint with the full Series title because sometimes it gets truncated on the right side (if its length exceeds that of remaining width of TChart component).
for the above, I need to first of know as when the user is bringing mouse cursor over the series title .
Thanking you in advance in anticipation
with warm Regards
Thanks for your kind reply.
Actually, I ws trying to get around another problem (TeeLineSeparator not working in displayed Series Titles in the graph).
I was thinking that if I can track the mouse cursor then atleast I can pop up some sort of hint with the full Series title because sometimes it gets truncated on the right side (if its length exceeds that of remaining width of TChart component).
for the above, I need to first of know as when the user is bringing mouse cursor over the series title .
Thanking you in advance in anticipation
with warm Regards
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Corey,
To check if the mouse is over the chart's title you can use OnMouseMove event and something like this:
For the hint, I suggest you to use annotation tools as told here.
To check if the mouse is over the chart's title you can use OnMouseMove event and something like this:
Code: Select all
procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if Chart1.Title.Clicked(X,Y) then
begin
//Put your hint code here.
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 |
-
- Newbie
- Posts: 8
- Joined: Fri Sep 02, 2005 4:00 am
but it does not works for series titles
Thanks once again for your kind reply but it does not works for the Series titles.
Please suggest some other alternatives.
I remeber using some sort of hit-detection in past, but am not able to get the details right. just as on TTreeview component, you can check if mouse cursor if over the button or image or text etc, same thing was somehow available in TChart also to know if the cursor is over the legend or title or axis etc etc.
Regards
Please suggest some other alternatives.
I remeber using some sort of hit-detection in past, but am not able to get the details right. just as on TTreeview component, you can check if mouse cursor if over the button or image or text etc, same thing was somehow available in TChart also to know if the cursor is over the legend or title or axis etc etc.
Regards
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Corey,
I'm afraid I didn't understood what you were looking for. To display series title you may be interested in using TMarkTipsTool and use its OnGetText event doing something like this:
I'm afraid I didn't understood what you were looking for. To display series title you may be interested in using TMarkTipsTool and use its OnGetText event doing something like this:
Code: Select all
procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var i: Integer;
begin
for i:=0 to Chart1.SeriesCount-1 do
if Chart1[i].Clicked(X,Y)<>-1 then
begin
SeriesIndex:=i;
break;
end;
end;
procedure TForm1.ChartTool1GetText(Sender: TMarksTipTool;
var Text: String);
begin
Text:=Chart1[SeriesIndex].Name;
//or
//Text:=Chart1[SeriesIndex].Title;
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 |