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.
labeling points
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi kualoa1,
1. Yes, you can use OnGetAxisLabel event for that.
2. You could try setting custom labels size, for example:
Hope this helps![/code]
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;
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 |
labeling points
thank you, not working for me ...
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.
Code: Select all
procedure Tbubble1f.Chart1GetAxisLabel(Sender: TChartAxis;
Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
begin
Chart1.Axes.Bottom.LabelsSize:=30;
end;
2) also, how to get the label to fully display but wrap in a specified width?
thank you.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi kualoa1,
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!
Ok, we call them marks, not labels . Also, LabelsSize doesn't set the limit to 30 characters but it's set to 30 pixels.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?
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 |
Instructions - How to post in this forum |
labeling points
thank you. I do not have a "series's OnGetMarkText event"; what to do?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
labeling points
there are none (series) in object inspector.
I have this code in the unit:
Series1:=TBubbleSeries.Create(self);
what do you suggest?
thank you.
I have this code in the unit:
Series1:=TBubbleSeries.Create(self);
what do you suggest?
thank you.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
Hope this helps!
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 |
Instructions - How to post in this forum |