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.
Axis.LabelsOnAxis does nothing
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 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
Pep Jorge
http://support.steema.com
http://support.steema.com
LabelsOnAxis
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.
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
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;
.....
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;
.....