Method to get min and max?


#1

Is there a way to get the min and max of a range of an axis? I only saw a way to get the span. I’m using the Android SDK.


#2

Hi.

The Axis class offers a number of methods which return a Range object, representing the particular chosen range of values. For example the method getCurrentDisplayedRange will return a Range object which represents the current displayed range of the axis. You can subsequently retrieve the min and max values of the range by using the methods getMinimum and getMaximum. These methods are present on the NumberRange and DateRange sub-classes of the Range class. Please note that the methods on the Axis class for retrieving ranges return a Range objects and as such a suitable cast to a NumberRange or DateRange will be necessary.

I hope that this helps.

Thanks, Kai.


#3

Thanks. This does the trick. However, I need the max and min so I can set the major tick marks. As soon as I do any tick mark manipulation, the top tick mark gets visually cut off in half. Setting any range padding is ignored, so I can’t fix this.