Axis alignment and margin reservation

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
huy
Newbie
Newbie
Posts: 22
Joined: Fri Dec 29, 2006 12:00 am

Axis alignment and margin reservation

Post by huy » Mon Nov 12, 2007 9:25 am

Hi TeeChart Team,

I have a question on axis positioning. It's quite difficult for me to explain in text without a picture, so I have uploaded a picture in which I have carefully annotated my observations and doubts.

In summary, I don't know how to reserve space for CUSTOM axis's labels. I know that if I use MarginLeft property and set it to a rather large value, I can reserve enough space for custom axis's labels. But I am not allowed to to so, since reserving marginleft in this way creates a large redundant area to the left of the DEFAULT Axes.Left axis. So my guess is that margin left really just affects the default axis Axes.Left and has no effect on my custom axis (why?!).

What I need to do is just to align the custom axes I create with the default axis Axes.Left, instead of the default behavior that aligns custom axes with the left edge of Axes.Left's labels!

Please have a look at the picture I uploaded to understand my point. The file is named:
"Axis alignment and margin reservation.jpg"

Thank you,
Huy

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

Post by Narcís » Mon Nov 12, 2007 10:02 am

Hi Huy,

You can do something as discussed here.

Hope this helps!
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

huy
Newbie
Newbie
Posts: 22
Joined: Fri Dec 29, 2006 12:00 am

Post by huy » Tue Nov 13, 2007 9:06 am

Hi Narcís,

Yes. This topic does bring me a clear idea of what to do.

The only thing left is that I can't call "MaxLabelsWidth"! The reason is calling this BEFORE the chart is drawn, makes the function return incorrect result instead of the maxlabelswidth.

In another post, you suggested that we first have to redraw the chart, so that the function works. However, this is not possible, since my data size is rather large and also, redrawing the chart even for a small data set causes a flicker.

I understand why you don't provide the method to return the result before the axis is draw. That's perhaps because of the ability of the chart to override axis labels whenever the labels are requested (as in GetAxisDrawlabel). But is there any feasible way for me to get the length of my axis label without having to first call to redraw chart?

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

Post by Narcís » Tue Nov 13, 2007 10:35 am

Hi huy,

In that case you may be interested in what was discussed on this thread. Please notice that it is quite long, I'd recommend you to read it entirely. At least, read the messages posted from the end of 2006.

Hope this helps!
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

huy
Newbie
Newbie
Posts: 22
Joined: Fri Dec 29, 2006 12:00 am

Post by huy » Thu Nov 15, 2007 1:07 am

This topic brings in several interesting points that I have not explored before. I am trying out the measure function in place of axismaxlabelswidth. It shows good results now. Thanks for the pointer.

Post Reply