SciChart iOS v2.x API > Axis APIs > Axis Alignment - Create a Vertical Chart
Axis Alignment - Create a Vertical Chart

It is possible to create Vertical (Rotated) Charts with SciChart. To achieve this, simply set AxisAlignment to Left or Right for X Axis and Top or Bottom for Y Axis. And that's it - SciChart takes care of the rest:

 

// XAxis on the LEFT
id<SCIAxis2DProtocol> axis = [[SCINumericAxis alloc] init];
axis.axisAlignment = SCIAxisAlignment_Left;
[axis setAxisTitle:@"X-Axis"];              
[surface.xAxes add:axis];

// and YAxis on the TOP
// rotates the chart vertically
id<SCIAxis2DProtocol> yAxis = [[SCINumericAxis alloc] init];
[yAxis setAxisTitle:@"Y-Axis"];
yAxis.axisAlignment = SCIAxisAlignment_Top;             
[surface.yAxes add:yAxis];
// XAxis on the LEFT
let xAxis = SCINumericAxis()
xAxis.axisTitle = "X-Axis"             
xAxis.axisAlignment = .left
xAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.01), max: SCIGeneric(0.01))
surface.xAxes.add(xAxis)

// and YAxis on the TOP
// rotates the chart vertically
let yAxis = SCINumericAxis()
yAxis.axisTitle = "Y-Axis"
yAxis.axisAlignment = .top              
surface.yAxes.add(yAxis)
// XAxis on the LEFT
var xAxis = new SCINumericAxis();
xAxis.AxisTitle = "X-Axis";
xAxis.AxisAlignment = SCIAxisAlignment.Left;
xAxis.GrowBy = new SCIDoubleRange(0.1, 0.1);
surface.XAxes.Add(xAxis);

// and YAxis on the TOP
// rotates the chart vertically
var yAxis = new SCINumericAxis();
yAxis.AxisTitle = "Y-Axis";
yAxis.AxisAlignment = SCIAxisAlignment.Top;
surface.YAxes.add(yAxis);

 

This results in the following output. Also viewable in our Vertical Charts demo.

 

See Also