Page 1 of 1

Axis alignment and margin reservation

Posted: Mon Nov 12, 2007 9:25 am
by 9643500
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

Posted: Mon Nov 12, 2007 10:02 am
by narcis
Hi Huy,

You can do something as discussed here.

Hope this helps!

Posted: Tue Nov 13, 2007 9:06 am
by 9643500
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?

Posted: Tue Nov 13, 2007 10:35 am
by narcis
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!

Posted: Thu Nov 15, 2007 1:07 am
by 9643500
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.