
iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x
Axis Ranging - Get or Set VisibleRange
How to modify VisibleRange for different Axis Types
To programmatically range an axis, set the property ISCIAxisCore.visibleRange
.
NOTE: The type of object that needs to be applied to the Axis VisibleRange depends on the axis type.
For more information about setting VisibleRange on particular Axis type - please see the following:
Adding Padding or Spacing with GrowBy
Also, it is possible to add spacing to the VisibleRange via the ISCIAxisCore.growBy
property. It allows to specify two fractions which will be always applied to the ISCIRange.min
, ISCIRange.max
values of the axes VisibleRange:
In the code snippet above, the GrowBy of 0.1 will be applied to the VisibleRange resulting in actual VisibleRange increased by a fraction of 0.1 (10%), i.e. Min = -1, Max = 11
.
Zooming to fit all the Data
Sometimes it is required to make an axis to show the full extent of the data associated with it. There are several ways to achieve this in code:
- set the
ISCIAxisCore.visibleRange
to theISCIAxisCore.dataRange
value. - configure the axis to auto adjust correspondingly to data changes. See the AutoRange article.
- call the
ISCIChartController
methods fromSCIChartSurface
such as-[ISCIChartController zoomExtents]
. - call the
ISCIChartController
methods fromISCIViewportManager
such as-[ISCIChartController zoomExtents]
.
To change the VisibleRange
by touch interaction with a chart, please read about our ChartModifier API.