Setting LabelText := '' in a chart's OnGetAxisLabel event causes axis labels to not be displayed in some cases. If this is done as a result of checking whether the label is a floating point number, then axis labels are not shown. For example :
for i := 0 to 5 do series1.AddXY(i,random(10));
and then in OnGetAxisLabel event saying either :
if trunc(strtofloat(LabelText)) <> strtofloat(LabelText) then LabelText := ''
or :
if pos('.', labeltext) <> 0 then LabelText := '';
causes the integer labels 2,3,4 to not be displayed. The OnGetAxisLabel event is not even fired for them. This appears to be due to the initial lables for the charts being floating point numbers (5.03 and -0.03) as seen by adding the LabelText to a memo in this event. Setting LabelText to a space character instead of an empty string avoids this problem.
LabelText := '' stops further labels from displaying
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Steve,
If you don't want to display decimal values at axes labels you could use:
If you don't want to display decimal values at axes labels you could use:
Code: Select all
Chart1.Axes.Left.AxisValuesFormat:='##';
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Steve,
Yes, you are right. I've been able to reproduce this and already added it to our deffect list to be fixed for future releases.
Yes, you are right. I've been able to reproduce this and already added it to our deffect list to be fixed for future releases.
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 |