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 axisAlignment property. Please see the code below:
final NumericAxis xTopAxis = new NumericAxis(getContext());
xTopAxis.setAxisId("TopAxisId");
xTopAxis.setAxisAlignment(AxisAlignment.Top);
final NumericAxis xBottomAxis = new NumericAxis(getContext());
xBottomAxis.setAxisId("BottomAxisId");
xBottomAxis.setAxisAlignment(AxisAlignment.Bottom);
final NumericAxis yLeftAxis = new NumericAxis(getContext());
yLeftAxis.setAxisId("LeftAxisId");
yLeftAxis.setAxisAlignment(AxisAlignment.Left);
final NumericAxis yRightAxis = new NumericAxis(getContext());
yRightAxis.setAxisId("RightAxisId");
yRightAxis.setAxisAlignment(AxisAlignment.Right);
The above code results in the following view. Also please see our Multiple X-Axis Chart.
Note
Every RenderableSeries (chart types e.g. FastLineRenderableSeries, FastCandlestickRenderableSeries etc.), every Annotation and some Chart Modifiers (e.g. PinchZoomModifier, ZoomPanModifier) requires to be measured against particular axis (in other words - attached to it). You must specify the Axis ID for them via the xAxisId and yAxisId 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.