Page 1 of 1

Axis.LabelsOnAxis does nothing

Posted: Tue Feb 28, 2006 8:42 am
by 8572678
Hello,
Axis.LabelsOnAxis is only used in InternalDrawLabel
LabelsOnAxis may be useful to not show labels out of Axis.MinimumOfset and Axis.MaximumOfset.

Also all labels should be in Axis.IStartPos and Axis.EndPos
Also Minimum Label rectangle should start Axis.EndPos to prove that multiple axis labels do not overlap.

Posted: Thu Mar 02, 2006 10:50 am
by Pep
Hi,

LabelsOnAxis may be useful to not show labels out of Axis.MinimumOfset and Axis.MaximumOfset.

The LabelsOnAxis property does not check this, as designed, but this can be solved by using the OnGetAxisLabel event :
if StrToFloat(labeltext) < Chart1.Axes.Bottom.Minimum then
labeltext := '';

>Also all labels should be in Axis.IStartPos and Axis.EndPos
I'm not sure what you refer here ..

>Also Minimum Label rectangle should start Axis.EndPos to prove that >multiple axis labels do not overlap.
You could solve this by setting an offset

LabelsOnAxis

Posted: Wed Mar 08, 2006 7:45 am
by 8572678
Firstly, StrToFloat(labeltext) is string.
It should be a double value to compare with Chart1.Axes.Bottom.Minimum.

Secondly,
For Chart1.Axes.Bottom.Minimum,
setting labeltext= '' has a potential problem.
Axis.MaxLabelWidth property uses mininum value.
So, Axis.MaxLabelWidth may be zero or less than actual value

>Also all labels should be in Axis.IStartPos and Axis.EndPos
>I'm not sure what you refer here ..
I have multiple vertical axes, their start and and position are same.
So sometimes, their minimum and maximum labels overlaps.
This proves that all labels are not in Axis.IStartPos and Axis.EndPos.

LabelsOnAxis

Posted: Wed Mar 08, 2006 7:56 am
by 8572678
I solve my problem by changing source code as below
set FLabelsOnAxis=false


Procedure InternalDrawLabel(var Value:Double; DecValue:Boolean);
var tmp,s,e,h : Integer;
Begin
.....
h:=LabelHeight(Value)div 2;
if StartPosition=0 then
s:=0
else
s:=h;
if EndPosition=100 then
e:=0
else
e:=h;
if FLabelsOnAxis or ((tmp-s>IStartPos) and (tmp+e<IEndPos)) then
begin
....
end;
.....