labeling points

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
kualoa1
Newbie
Newbie
Posts: 27
Joined: Fri Nov 21, 2008 12:00 am

labeling points

Post by kualoa1 » Tue Nov 25, 2008 1:39 pm

using delphi with a chart,

1) my labels are long and I want to set a width (eg 75px) and then have the label wrap - how to do this?

2) the labels often overlap, is there an "avoid overlap" setting?

Thank you.

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

Post by Narcís » Tue Nov 25, 2008 1:53 pm

Hi kualoa1,

1. Yes, you can use OnGetAxisLabel event for that.
2. You could try setting custom labels size, for example:

Code: Select all

  Chart1.Axes.Bottom.LabelsSize:=30;
Hope this helps![/code]
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

kualoa1
Newbie
Newbie
Posts: 27
Joined: Fri Nov 21, 2008 12:00 am

labeling points

Post by kualoa1 » Tue Nov 25, 2008 2:51 pm

thank you, not working for me ...

Code: Select all

procedure Tbubble1f.Chart1GetAxisLabel(Sender: TChartAxis;
  Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
begin
  Chart1.Axes.Bottom.LabelsSize:=30;
end;
1) The label displayed on the chart, not the axis, is still not limited by 30 characters

2) also, how to get the label to fully display but wrap in a specified width?

thank you.

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

Post by Narcís » Tue Nov 25, 2008 3:01 pm

Hi kualoa1,
1) The label displayed on the chart, not the axis, is still not limited by 30 characters
Ok, we call them marks, not labels :wink:. Also, LabelsSize doesn't set the limit to 30 characters but it's set to 30 pixels.
2) also, how to get the label to fully display but wrap in a specified width?


Ok, in that case you should use series's OnGetMarkText event.

To check if marks overlap you can do something as what Pep suggested here. This is a TeeChart for .NET example but the same is possible with the VCL version.

For more information on how to set custom marks position with TeeChart VCL please read this thread.

Hope this helps!
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

kualoa1
Newbie
Newbie
Posts: 27
Joined: Fri Nov 21, 2008 12:00 am

labeling points

Post by kualoa1 » Tue Nov 25, 2008 3:07 pm

thank you. I do not have a "series's OnGetMarkText event"; what to do?

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

Post by Narcís » Tue Nov 25, 2008 3:19 pm

Hi kualoa1,

All TeeChart series have this event. You'd better create them at designtime. Please go to Delphi's Object Inspector. Select a series in the combobox there, select its "Events" tab and double click on OnGetMarkText's combobox to generate the event.

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
Image Image Image Image Image Image
Instructions - How to post in this forum

kualoa1
Newbie
Newbie
Posts: 27
Joined: Fri Nov 21, 2008 12:00 am

labeling points

Post by kualoa1 » Tue Nov 25, 2008 3:43 pm

there are none (series) in object inspector.

I have this code in the unit:
Series1:=TBubbleSeries.Create(self);

what do you suggest?

thank you.

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

Post by Narcís » Tue Nov 25, 2008 4:29 pm

Hi kualoa1,

That's why I suggested you to create series at designtime. Otherwise you can create a dummy series at designtime, generate the event for this series, assign the event to your series like in the code snippet below and then remove dummy series.

Code: Select all

  MySeries.OnGetMarkText:=Series1GetMarkText;


Hope this helps!
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