iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x

Axis Alignment - Setting AxisAlignment

SciChart supports unlimited, multiple X or Y axes which can be aligned to the Right, Left, Top, Bottom sides of a chart. Axis may be placed by setting the ISCIAxisCore.axisAlignment property. Please see the code below:

id<ISCIAxis> xTopAxis = [SCINumericAxis new]; xTopAxis.axisId = TopAxisId; xTopAxis.axisAlignment = SCIAxisAlignment_Top; id<ISCIAxis> xBottomAxis = [SCINumericAxis new]; xBottomAxis.axisId = BottomAxisId; xBottomAxis.axisAlignment = SCIAxisAlignment_Bottom; id<ISCIAxis> yLeftAxis = [SCINumericAxis new]; yLeftAxis.axisId = LeftAxisId; yLeftAxis.axisAlignment = SCIAxisAlignment_Left; id<ISCIAxis> yRightAxis = [SCINumericAxis new]; yRightAxis.axisId = RightAxisId; yRightAxis.axisAlignment = SCIAxisAlignment_Right;
let xTopAxis = SCINumericAxis() xTopAxis.axisId = TopAxisId xTopAxis.axisAlignment = .top let xBottomAxis = SCINumericAxis() xBottomAxis.axisId = BottomAxisId xBottomAxis.axisAlignment = .bottom let yLeftAxis = SCINumericAxis() yLeftAxis.axisId = LeftAxisId yLeftAxis.axisAlignment = .left let yRightAxis = SCINumericAxis() yRightAxis.axisId = RightAxisId yRightAxis.axisAlignment = .right
var xTopAxis = new SCINumericAxis { AxisId = “TopAxisId”, AxisAlignment = SCIAxisAlignment.Top, }; var xBottomAxis = new SCINumericAxis { AxisId = “BottomAxisId”, AxisAlignment = SCIAxisAlignment.Bottom, }; var yLeftAxis = new SCINumericAxis { AxisId = “LeftAxisId”, AxisAlignment = SCIAxisAlignment.Left, }; var yRightAxis = new SCINumericAxis { AxisId = “RightAxisId”, AxisAlignment = SCIAxisAlignment.Right, };

The above code results in the following view. Also please see our Multiple Axis Demo.

Axis Alignment

NOTE: Every RenderableSeries (chart types e.g. SCIFastLineRenderableSeries, SCIFastCandlestickRenderableSeries etc.), every Annotation and some Chart Modifiers (e.g. SCIPinchZoomModifier, SCIZoomPanModifier) requires to be measured against particular axis (in other words - attached to it). You must specify the Axis ID for them via the ISCIRenderableSeries.xAxisId and ISCIRenderableSeries.xAxisId properties.

However, If you have only a single X and Y Axis setting these ID properties isn’t required. This is required only for the multiple axis cases.