Labels on axis may start and end at a certain position

Ideas and wishes for TeeChart
Post Reply
fnn
Newbie
Newbie
Posts: 10
Joined: Fri Nov 15, 2002 12:00 am

Labels on axis may start and end at a certain position

Post by fnn » Thu Feb 23, 2006 4:08 pm

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.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Feb 24, 2006 9:26 am

Hello,

Try setting vertical axes from 0 to 79 and from 80 to 100 respectively. Does it work fine for you?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

fnn
Newbie
Newbie
Posts: 10
Joined: Fri Nov 15, 2002 12:00 am

OnGetAxisLabel

Post by fnn » Mon Feb 27, 2006 3:25 pm

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.

Golli
Newbie
Newbie
Posts: 4
Joined: Mon Mar 08, 2004 5:00 am
Location: USA

Axis Labeling

Post by Golli » Fri Mar 03, 2006 3:47 pm

Axis labeling can be very unpredictable in TChart. It would be great if more attention was paid to this by the developers.

Pep
Site Admin
Site Admin
Posts: 3273
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Mar 07, 2006 5:37 pm

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 ?

Post Reply