Axis Ranging - AutoRange
At the outset, the VisibleRange is adjusted to be equal to the DataRange of an axis. However, an axis won't adjust its VisibleRange automatically when data changes, unless it is configured to do this. The default behavior can be changed by applying different AutoRange modes on setAutoRange(AutoRange autoRange).
Note
Setting an explicit setVisibleRange(IRange visibleRange) on the axis will override this behaviour.
AutoRange Once
This is the default setting. The axis will attempt to autorange once to fit the data as you start the chart. This is a one-time action - the setVisibleRange(IRange visibleRange) won't adjust to any data changes in future.
final NumericAxis axis = new NumericAxis(getContext());
axis.setAutoRange(AutoRange.Once);
AutoRange Always
In this mode, the axis will attempt to autorange always to fit the data every time the chart is drawn. The VisibleRange will adjust to data changes correspondingly.
Note
Please be aware that this setting will override any other ranging, including zooming and panning by modifiers, but is useful in situations where you always want to view the extents of the data.
final NumericAxis axis = new NumericAxis(getContext());
axis.setAutoRange(AutoRange.Always);
AutoRange Never
The axis will never autorange. With this option, you would need to set the setVisibleRange(IRange visibleRange) manually. The VisibleRange won't adjust to any data changes.
final NumericAxis axis = new NumericAxis(getContext());
axis.setAutoRange(AutoRange.Never);
Using ViewportManager
The AutoRange behavior can be completely overridden if necessary. The IViewportManager provides the full access to and control over axis ranges and viewport. The default implementation of IViewportManager is the DefaultViewportManager class. Custom ViewportManagers can be assigned via viewportManager property.