Mark tips Style

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
IQSoft
Newbie
Newbie
Posts: 20
Joined: Mon Jun 18, 2007 12:00 am
Location: Greece
Contact:

Mark tips Style

Post by IQSoft » Wed Jun 18, 2008 8:15 am

Is there a way to display in mark tips Series name and X.Y values??????
Thanks
Alex

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Wed Jun 18, 2008 9:32 am

Hi Alex,

Yes, with OnGetMarkText event, from your series, you can customize its mark text as you want:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.Marks.Visible := True;
end;

procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
  ValueIndex: Integer; var MarkText: String);
begin
    MarkText := Sender.Name + '   X: ' + floattostr(Sender.XValues.Items[ValueIndex]) +
              '   Y: ' + floattostr(Sender.YValues.Items[ValueIndex]);
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

IQSoft
Newbie
Newbie
Posts: 20
Joined: Mon Jun 18, 2007 12:00 am
Location: Greece
Contact:

Post by IQSoft » Wed Jun 18, 2008 10:18 am

If i undestand well you mean you can customize the text of the marks on the chart.....
I want to use the MArk Tips Tools and display Name , X,Y value....
Is it possible

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Jun 18, 2008 10:23 am

Hi IQSoft,

Yes, the MarkTips tool display marks text even if it's customized.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

IQSoft
Newbie
Newbie
Posts: 20
Joined: Mon Jun 18, 2007 12:00 am
Location: Greece
Contact:

Post by IQSoft » Wed Jun 18, 2008 11:16 am

it can be customized the same way?????
Alex

IQSoft
Newbie
Newbie
Posts: 20
Joined: Mon Jun 18, 2007 12:00 am
Location: Greece
Contact:

Post by IQSoft » Wed Jun 18, 2008 11:17 am

I can be customized by code or by the user ( editing the diagram???)

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Jun 18, 2008 11:36 am

Hi Alex,

It can be customized programmatically using the OnGetText event.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

IQSoft
Newbie
Newbie
Posts: 20
Joined: Mon Jun 18, 2007 12:00 am
Location: Greece
Contact:

Post by IQSoft » Thu Jun 19, 2008 11:45 am

Can i have a small sample of customizing text?????
Thanks
Alex

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jun 19, 2008 12:02 pm

Hi Alex,

You just need to add a TMarksTipTool to your application and make series marks not visible. The code Yeray posted will modify tool's text as well, for example:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.Marks.Visible := False;
end;

procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
  ValueIndex: Integer; var MarkText: String);
begin
  MarkText := Sender.Name + ' X: ' + FloatToStr(Sender.XValues.Items[ValueIndex]) +
              ' Y: ' + FloatToStr(Sender.YValues.Items[ValueIndex]);
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
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply