With a TMarksTipTool.OnGetText, there is no .Index property that I can find to know what help should be pointing at.
Any suggestions on how to find this?
Ed Dressel
TMarksTipTool: OnHint index?
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
Re: TMarksTipTool: OnHint index?
Hi Ed,
You could set the MarkTips Style to be smsPointIndex and use it at ChartTool1GetText:
You could set the MarkTips Style to be smsPointIndex and use it at ChartTool1GetText:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
ChartTool1.Style:=smsPointIndex;
end;
procedure TForm1.ChartTool1GetText(Sender: TMarksTipTool; var Text: String);
var ValueIndex: Integer;
begin
ValueIndex:=StrToInt(Text);
Text:='X: ' + FloatToStr(Sender.Series.XValue[ValueIndex]) + #13 + 'Y: ' + FloatToStr(Sender.Series.YValue[ValueIndex]);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TMarksTipTool: OnHint index?
Hi, i found that topic and i must say that you need to change the event because when you use that tool on All Series, the Sender.Series = Nil
So, it should be a good idea to make it nice and add the Index and Series that as been "clicked / moved on" for the hint.
So, it should be a good idea to make it nice and add the Index and Series that as been "clicked / moved on" for the hint.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TMarksTipTool: OnHint index?
Hi GotoXY,
A safeguard could be implementing the event like this:Hi, i found that topic and i must say that you need to change the event because when you use that tool on All Series, the Sender.Series = Nil
Code: Select all
procedure TForm1.ChartTool1GetText(Sender: TMarksTipTool;
var Text: String);
begin
if Assigned(Sender.Series) then
begin
ValueIndex:=StrToInt(Text);
Text:='X: ' + FloatToStr(Sender.Series.XValue[ValueIndex]) + #13 + 'Y: ' + FloatToStr(Sender.Series.YValue[ValueIndex]);
end;
end;
It can be easily found using TeeChart's mouse events combined with series' Clicked method. Anyway, I have added your request to the wish-list (TV52015263) to be considered for inclusion in future releases.So, it should be a good idea to make it nice and add the Index and Series that as been "clicked / moved on" for the hint.
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 |