Page 1 of 1
Labels on axis may start and end at a certain position
Posted: Thu Feb 23, 2006 4:08 pm
by 8572678
I have a candle series and a volume series.
Candle series vertical axis startposition 0 and endposition 80
Volume series vertical axis startposition 80 and endposition 100.
And there is a seperator between them.
Mininum label value of candle and maximum label value of volume
sometimes overlaps.
Posted: Fri Feb 24, 2006 9:26 am
by narcis
Hello,
Try setting vertical axes from 0 to 79 and from 80 to 100 respectively. Does it work fine for you?
OnGetAxisLabel
Posted: Mon Feb 27, 2006 3:25 pm
by 8572678
Yes, I know.
But I do not want to change Axis bounds.
Also, Axis.StartPosition and Axis.EndPosition are in percent not in pixels.
I use Axis.MinimumOfset and Axis.MaximumOfset.
But axis labels appear out of ofset range.
in OnGetAxisLabel
//I need a double value, but labeltext is string
I try to set labeltext empty string,
labelvalue:=StrToFloat(labeltext );
Delta:=11;//set label height;
if sender.EndPosition<>100 then
begin
minvalue:=sender.CalcPosPoint(sender.IEndPos-Delta);
if labelvalue <minvalue then
begin
labeltext:='';
exit;
end;
end;
if sender.StartPosition<>0 then
begin
maxvalue:=sender.CalcPosPoint(sender.IStartPos+Delta);
if labelvalue >maxvalue then
begin
labeltext:='';
exit;
end;
end;
A potential problem:
Axis.MaxLabelWidth calls OnGetAxisLabel event.
But if labeltext is empty string, then Axis.MaxLabelWidth is not
actual Axis.MaxLabelWidth
Sometimes a few labels appear on axis.
Axis Labeling
Posted: Fri Mar 03, 2006 3:47 pm
by 9336033
Axis labeling can be very unpredictable in TChart. It would be great if more attention was paid to this by the developers.
Posted: Tue Mar 07, 2006 5:37 pm
by Pep
Hi,
using maximum and minimum offset should do the trick :
Chart1.Axes.Left.MinimumOffset:=10;
Chart1.CustomAxes[0].MaximumOffset:=10;
Which is the problem using them ?