MaxLabelsWidth returns value too high
Posted: Wed Oct 10, 2007 12:09 pm
I have one TLineSeries in Chart and try to connect it to LeftAxis or custom axis.
When series is connected to LeftAxis width of left axis area is automatically adjusted so that all labels are visible and area is not to wide. I can set Minimum/Maximum of LeftAxis to 1 .. 100 or 1.1111 .. 100 and first label is always 10 and last 100. Left axis area width is correct.
When series is connected to custom axis (LeftAsix is not connected to any series) I have to set Chart MarginLeft property to make place for custom axis. Width of left margin is equal to value returned by function customAxis->MaxLabelsWidth(). When I set Minimum/Maximum of custom axis to 1 .. 100 first label is 10 and last 100. MaxLabelsWidth returns correct value.
But when I set Minimum/Maximum of custom axis to 1.1111 .. 100 MaxLabelsWidth returns number too big . It looks like value returned by MaxLabelsWidth is big enough to make place to draw number 1.1111. But first label of axis is 10 not 1.1111.
What should I do to calculate max width of labels drawn by custom axis?
When series is connected to LeftAxis width of left axis area is automatically adjusted so that all labels are visible and area is not to wide. I can set Minimum/Maximum of LeftAxis to 1 .. 100 or 1.1111 .. 100 and first label is always 10 and last 100. Left axis area width is correct.
When series is connected to custom axis (LeftAsix is not connected to any series) I have to set Chart MarginLeft property to make place for custom axis. Width of left margin is equal to value returned by function customAxis->MaxLabelsWidth(). When I set Minimum/Maximum of custom axis to 1 .. 100 first label is 10 and last 100. MaxLabelsWidth returns correct value.
But when I set Minimum/Maximum of custom axis to 1.1111 .. 100 MaxLabelsWidth returns number too big . It looks like value returned by MaxLabelsWidth is big enough to make place to draw number 1.1111. But first label of axis is 10 not 1.1111.
What should I do to calculate max width of labels drawn by custom axis?