iOS Charting Documentation - SciChart
Axis Types in SciChart

Axis Types

SciChart iOS features several axis types. All inherit from SCIAxisBase. A list of the axis types are found below:

Axis Type

Value or Category

SCINumericAxis

Value Axis

SCILogarithmicNumericAxis

Value Axis

SCIDateTimeAxis

Value Axis

SCICategoryNumericAxis

Category Axis

SCICategoryDateTimeAxis

Category Axis

A description of What is a Value Axis and What is a Category Axis can be found at the following documentation page: Value Axis vs. Category Axis.

The SCINumericAxis Type

The SCINumericAxis is a Value-Axis and is suitable for X and Y Axis when the data type on that axis is numeric (e.g. double, int, long, float, short).

The SCIChartSurface requires that you declare an X and a Y Axis before any series can be added to the chart. You can declaring a SCINumericAxis with the following code:

// Create instances of SCIChartSurface, XAxis, YAxis
SCIChartSurface * scs = [[SCIChartSurface alloc] init];
SCINumericAxis * xAxis = [[SCINumericAxis alloc] init];
SCINumericAxis * yAxis = [[SCINumericAxis alloc] init];

// SCINumericAxis accepts types Double, Int, Long, Float, Short for data and SCIDoubleRange for VisibleRange.
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
[xAxis setVisibleRange: [[SCIDoubleRange alloc]initWithMin:SCIGeneric(0.0) Max:SCIGeneric(100.0)]];

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
[xAxis setGrowBy: [[SCIDoubleRange alloc]initWithMin:SCIGeneric(0.1) Max:SCIGeneric(0.1)]];

// Set TextFormatting (uses NSString formatting), Axis Title
xAxis.textFormatting = @"%.02f";
yAxis.textFormatting = @"%.02f";
xAxis.axisTitle = @"XAxis Title";
yAxis.axisTitle = @"YAxis Title";

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
[xAxis setAxisAlignment:SCIAxisAlignment_Bottom];
[yAxis setAxisAlignment:SCIAxisAlignment_Left];
// Add the axis to the chart
[scs.xAxes add:xAxis];
[scs.yAxes add:yAxis];
// Create instances of SCIChartSurface, XAxis, YAxis
var scs = SCIChartSurface()
var xAxis = SCINumericAxis()
var yAxis = SCINumericAxis()

// SCINumericAxis accepts types Double, Int, Long, Float, Short for data and SCIDoubleRange for VisibleRange.
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
xAxis.visibleRange = SCIDoubleRange(min: SCIGeneric(0.0), max: SCIGeneric(100.0))

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
xAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.1), max: SCIGeneric(0.1))

// Set TextFormatting (uses NSString formatting), Axis Title
xAxis.textFormatting = "%.02f"
yAxis.textFormatting = "%.02f"
xAxis.axisTitle = "XAxis Title"
yAxis.axisTitle = "YAxis Title"

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
xAxis.axisAlignment = SCIAxisAlignment_Bottom
yAxis.axisAlignment = SCIAxisAlignment_Left

// Add the axis to the chart
scs.xAxes.add(xAxis)
scs.yAxes.add(yAxis)
// Create instances of SCIChartSurface, XAxis, YAxis
var scs = new SCIChartSurface();
var xAxis = new SCINumericAxis();
var yAxis = new SCINumericAxis();

// SCINumericAxis accepts types Double, Int, Long, Float, Short for data and SCIDoubleRange for VisibleRange.
xAxis.VisibleRange = new SCIDoubleRange(0.0, 100.0);

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
xAxis.GrowBy = new SCIDoubleRange(0.1, 0.1);

// Set TextFormatting (uses NSString formatting), Axis Title
xAxis.TextFormatting = "%.02f";
yAxis.TextFormatting = "%.02f";
xAxis.AxisTitle = "XAxis Title";
yAxis.AxisTitle = "YAxis Title";

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
xAxis.AxisAlignment = SCIAxisAlignment.Bottom;
yAxis.AxisAlignment = SCIAxisAlignment.Left;

// Add the axis to the chart
scs.XAxes.Add(xAxis);
scs.YAxes.Add(yAxis);

 

The SCIDateTimeAxis Type

The SCIDateTimeAxis is a Value-Axis suitable for the XAxis only when the data is a DateTime. It is not suitable for other data-types.

Declaring a SCIDateTimeAxis can be done with the following code

// Create instances of SCIChartSurface, XAxis, YAxis
SCIChartSurface * scs = [[SCIChartSurface alloc] init];
SCIDateTimeAxis * xAxis = [[SCIDateTimeAxis alloc] init];
SCINumericAxis * yAxis = [[SCINumericAxis alloc] init];

// SCIDateTimeAxis accepts type DateTime for data and SCIDateRange for VisibleRange.
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
NSDate * minXRange = [[NSDate alloc] init];
NSDate * maxXRange = [minXRange dateByAddingTimeInterval: 86400];
[xAxis setVisibleRange: [[SCIDateRange alloc]initWithDateMin:minXRange Max:maxXRange]];

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
[xAxis setGrowBy: [[SCIDoubleRange alloc]initWithMin:SCIGeneric(0.1) Max:SCIGeneric(0.1)]];

// Set TextFormatting (uses NSString formatting), Axis Title
xAxis.textFormatting = @"dd/MM/yyyy";
yAxis.textFormatting = @"%.02f";
xAxis.axisTitle = @"XAxis Title";
yAxis.axisTitle = @"YAxis Title";

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
[xAxis setAxisAlignment:SCIAxisAlignment_Bottom];
[yAxis setAxisAlignment:SCIAxisAlignment_Left];

// Add the axis to the chart
[scs.xAxes add:xAxis];
[scs.yAxes add:yAxis];
// Create instances of SCIChartSurface, XAxis, YAxis
var scs = SCIChartSurface()
var xAxis = SCIDateTimeAxis()
var yAxis = SCINumericAxis()

// SCIDateTimeAxis accepts type DateTime for data and SCIDateRange for VisibleRange.
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
var minXRange = Date()
var maxXRange = minXRange.addingTimeInterval(86400) as? Date
xAxis.visibleRange = SCIDateRange(dateMin: minXRange, max: maxXRange)

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
xAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.1), max: SCIGeneric(0.1))

// Set TextFormatting (uses NSString formatting), Axis Title
xAxis.textFormatting = "dd/MM/yyyy"
yAxis.textFormatting = "%.02f"
xAxis.axisTitle = "XAxis Title"
yAxis.axisTitle = "YAxis Title"

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
xAxis.axisAlignment = SCIAxisAlignment_Bottom
yAxis.axisAlignment = SCIAxisAlignment_Left

// Add the axis to the chart
scs.xAxes.add(xAxis)
scs.yAxes.add(yAxis)
// Create instances of SCIChartSurface, XAxis, YAxis
var scs = new SCIChartSurface();
var xAxis = new SCIDateTimeAxis();
var yAxis = new SCINumericAxis();

// SCINumericAxis accepts types Double, Int, Long, Float, Short for data and SCIDoubleRange for VisibleRange.
xAxis.VisibleRange = new SCIDateRange(DateTime.Now, DateTime.Now.AddDays(1));

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
xAxis.GrowBy = new SCIDoubleRange(0.1, 0.1);

// Set TextFormatting (uses NSString formatting), Axis Title
xAxis.TextFormatting = "dd/MM/yyyy";
yAxis.TextFormatting = "%.02f";
xAxis.AxisTitle = "XAxis Title";
yAxis.AxisTitle = "YAxis Title";

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
xAxis.AxisAlignment = SCIAxisAlignment.Bottom;
yAxis.AxisAlignment = SCIAxisAlignment.Left;

// Add the axis to the chart
scs.XAxes.Add(xAxis);
scs.YAxes.Add(yAxis);

 

The SCILogarithmicNumericAxis Type

The SCILogarithmicNumericAxis is a Value-Axis with a configurable logarithmic base (e.g. Base 2, E, 10) and is suitable for the XAxis and YAxis when the data on that axis is numeric (e.g. double, int, float, long, short).

Declaring a SCILogarithmicNumericAxis can be done with the following code

// Create instances of SCIChartSurface, XAxis, YAxis
SCIChartSurface * scs = [[SCIChartSurface alloc] init];
SCINumericAxis * xAxis = [[SCINumericAxis alloc] init];
SCILogarithmicNumericAxis * yAxis = [[SCILogarithmicNumericAxis alloc] init];

// Set the LogarithmicBase, e.g. 2, E, or 10.0
yAxis.logarithmicBase = M_E;

// SCILogarithmicNumericAxis accepts types Double, Int, Long, Float, Short for data and SCIDoubleRange for VisibleRange.
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
// Note that both Min and Max visible range must be the same sign. Zero values are not allowed
[yAxis setVisibleRange: [[SCIDoubleRange alloc]initWithMin:SCIGeneric(0.001) Max:SCIGeneric(100.0)]];

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
[yAxis setGrowBy: [[SCIDoubleRange alloc]initWithMin:SCIGeneric(0.0) Max:SCIGeneric(0.1)]];

// Set TextFormatting (uses NSString formatting), Axis Title
xAxis.textFormatting = @"%.02f";
yAxis.textFormatting = @"%.02f";
xAxis.axisTitle = @"XAxis Title";
yAxis.axisTitle = @"YAxis Title";

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
[xAxis setAxisAlignment:SCIAxisAlignment_Bottom];
[yAxis setAxisAlignment:SCIAxisAlignment_Left];

// Add the axis to the chart
[scs.xAxes add:xAxis];
[scs.yAxes add:yAxis];
// Create instances of SCIChartSurface, XAxis, YAxis
var scs = SCIChartSurface()
var xAxis = SCINumericAxis()
var yAxis = SCILogarithmicNumericAxis()

// Set the LogarithmicBase, e.g. 2, E, or 10.0
yAxis.logarithmicBase = M_E

// SCILogarithmicNumericAxis accepts types Double, Int, Long, Float, Short for data and SCIDoubleRange for VisibleRange.
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
// Note that both Min and Max visible range must be the same sign. Zero values are not allowed.
yAxis.visibleRange = SCIDoubleRange(min: SCIGeneric(0.001), max: SCIGeneric(100.0))

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
yAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.0), max: SCIGeneric(0.1))

// Set TextFormatting (uses NSString formatting), Axis Title
xAxis.textFormatting = "%.02f"
yAxis.textFormatting = "%.02f"
xAxis.axisTitle = "XAxis Title"
yAxis.axisTitle = "YAxis Title"

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
xAxis.axisAlignment = SCIAxisAlignment_Bottom
yAxis.axisAlignment = SCIAxisAlignment_Left
// Add the axis to the chart
scs.xAxes.add(xAxis)
scs.yAxes.add(yAxis)
// Create instances of SCIChartSurface, XAxis, YAxis
var scs = new SCIChartSurface();           
var xAxis = new SCILogarithmicNumericAxis();
var yAxis = new SCILogarithmicNumericAxis();

// Set the LogarithmicBase, e.g. 2, E, or 10.0
yAxis.LogarithmicBase = Math.E;

// SCINumericAxis accepts types Double, Int, Long, Float, Short for data and SCIDoubleRange for VisibleRange.
yAxis.VisibleRange = new SCIDoubleRange(0.001, 100.0);

// Growby which adds optional Min and Max padding is always type SCIDoubleRange            
yAxis.GrowBy = new SCIDoubleRange(0.0, 0.1);

// Set TextFormatting (uses NSString formatting), Axis Title
xAxis.TextFormatting = "%.02f";
yAxis.TextFormatting = "%.02f";
xAxis.AxisTitle = "XAxis Title";
yAxis.AxisTitle = "YAxis Title";

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
xAxis.AxisAlignment = SCIAxisAlignment.Bottom;
yAxis.AxisAlignment = SCIAxisAlignment.Left;

// Add the axis to the chart
scs.XAxes.Add(xAxis);
scs.YAxes.Add(yAxis);

 

The SCICategoryDateTimeAxis Type

The SCICategoryDateTimeAxis is a Category-Axis which displays X-values as dates, but uses the index of the x-value to measure on the XAxis. For more information, see the article Value Axis vs. Category Axis. This axis type is suitable for an XAxis but not as a YAxis.

Declaring a SCICategoryDateTimeAxis can be done with the following code

// Create instances of SCIChartSurface, XAxis, YAxis
SCIChartSurface * scs = [[SCIChartSurface alloc] init];
SCICategoryDateTimeAxis * xAxis = [[SCICategoryDateTimeAxis alloc] init];
SCINumericAxis * yAxis = [[SCINumericAxis alloc] init];

// SCICategoryDateTimeAxis accepts type DateTime for data
// and SCIIndexRange for VisibleRange (specifyng the index to the data)
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
[xAxis setVisibleRange: [[SCIIndexRange alloc]initWithMin:SCIGeneric(0) Max:SCIGeneric(100)]];

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
[xAxis setGrowBy: [[SCIDoubleRange alloc]initWithMin:SCIGeneric(0.0) Max:SCIGeneric(0.1)]];

// Set TextFormatting (uses NSString formatting), Axis Title
xAxis.textFormatting = @"dd/MM/yyyy";
yAxis.textFormatting = @"%.02f";
xAxis.axisTitle = @"XAxis Title";
yAxis.axisTitle = @"YAxis Title";

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
[xAxis setAxisAlignment:SCIAxisAlignment_Bottom];
[yAxis setAxisAlignment:SCIAxisAlignment_Left];

// Add the axis to the chart
[scs.xAxes add:xAxis];
[scs.yAxes add:yAxis];
// Create instances of SCIChartSurface, XAxis, YAxis
var scs = SCIChartSurface()
var xAxis = SCICategoryDateTimeAxis()
var yAxis = SCINumericAxis()

// SCICategoryDateTimeAxis accepts type NSDate for data
// and SCIIndexRange for VisibleRange (specifyng the index to the data)
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
xAxis.visibleRange = SCIIndexRange(min: SCIGeneric(0), max: SCIGeneric(10))

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
xAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.1), max: SCIGeneric(0.1))

// TextFormatting, Title
xAxis.textFormatting = "dd/MM/yyyy"
yAxis.textFormatting = "%.02f"
xAxis.axisTitle = "XAxis Title"
yAxis.axisTitle = "YAxis Title"

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
xAxis.axisAlignment = SCIAxisAlignment_Bottom
yAxis.axisAlignment = SCIAxisAlignment_Left

// Add the axis to the chart
scs.xAxes.add(xAxis)
scs.yAxes.add(yAxis)
// Create instances of SCIChartSurface, XAxis, YAxis
var scs = new SCIChartSurface();
var xAxis = new SCICategoryDateTimeAxis();
var yAxis = new SCINumericAxis();

// SCICategoryDateTimeAxis accepts type NSDate for data
// and SCIIndexRange for VisibleRange (specifyng the index to the data)
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
xAxis.VisibleRange = new SCIIndexRange(0, 10);

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
xAxis.GrowBy = new SCIDoubleRange(0.0, 0.1);

// TextFormatting, Title
xAxis.TextFormatting = "dd/MM/yyyy";
yAxis.TextFormatting = "%.02f";
xAxis.AxisTitle = "XAxis Title";
yAxis.AxisTitle = "YAxis Title";

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
xAxis.AxisAlignment = SCIAxisAlignment.Bottom;
yAxis.AxisAlignment = SCIAxisAlignment.Left;

// Add the axis to the chart
scs.XAxes.Add(xAxis);
scs.YAxes.Add(yAxis);

 

The SCICategoryNumericAxis Type

The SCICategoryNumericAxis is a Category-Axis which displays X-values as numbers, but uses the index of the x-value to measure on the XAxis. For more information, see the article Value Axis vs. Category Axis. This axis type is suitable for an XAxis but not as a YAxis.

Declaring a SCICategoryNumericAxis can be done with the following code

// Create instances of SCIChartSurface, XAxis, YAxis
SCIChartSurface * scs = [[SCIChartSurface alloc] init];
SCICategoryNumericAxis* xAxis = [[SCICategoryNumericAxis alloc] init];
SCINumericAxis * yAxis = [[SCINumericAxis alloc] init];

// SCICategoryNumericAxisaccepts type Double, Long, Int, Float for data
// and SCIIndexRange for VisibleRange (specifyng the index to the data)
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
[xAxis setVisibleRange: [[SCIIndexRange alloc]initWithMin:SCIGeneric(0) Max:SCIGeneric(100)]];

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
[xAxis setGrowBy: [[SCIDoubleRange alloc]initWithMin:SCIGeneric(0.0) Max:SCIGeneric(0.1)]];

// Set TextFormatting (uses NSString formatting), Axis Title
xAxis.textFormatting = @"%.02f";
yAxis.textFormatting = @"%.02f";
xAxis.axisTitle = @"XAxis Title";
yAxis.axisTitle = @"YAxis Title";

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
[xAxis setAxisAlignment:SCIAxisAlignment_Bottom];
[yAxis setAxisAlignment:SCIAxisAlignment_Left];

// Add the axis to the chart
[scs.xAxes add:xAxis];
[scs.yAxes add:yAxis];
// Create instances of SCIChartSurface, XAxis, YAxis
var scs = SCIChartSurface()
var xAxis = SCICategoryNumericAxis()
var yAxis = SCINumericAxis()

// SCICategoryNumericAxis accepts type Double, Int, Long, Float for data
// and SCIIndexRange for VisibleRange (specifyng the index to the data)
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
xAxis.visibleRange = SCIIndexRange(min: SCIGeneric(0), max: SCIGeneric(10))

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
xAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.0), max: SCIGeneric(0.1))

// TextFormatting, Title
xAxis.textFormatting = "%.02f"
yAxis.textFormatting = "%.02f"
xAxis.axisTitle = "XAxis Title"
yAxis.axisTitle = "YAxis Title"

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
xAxis.axisAlignment = SCIAxisAlignment_Bottom
yAxis.axisAlignment = SCIAxisAlignment_Left

// Add the axis to the chart
scs.xAxes.add(xAxis)
scs.yAxes.add(yAxis)
// Create instances of SCIChartSurface, XAxis, YAxis
var scs = new SCIChartSurface();
var xAxis = new SCICategoryNumericAxis();
var yAxis = new SCINumericAxis();

// SCICategoryNumericAxis accepts type Double, Int, Long, Float for data
// and SCIIndexRange for VisibleRange (specifyng the index to the data)
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
xAxis.VisibleRange = new SCIIndexRange(0, 10);

// Growby which adds optional Min and Max padding is always type SCIDoubleRange
// SCIGeneric is used to marshal between iOS types and faster SciChart primitive types
xAxis.GrowBy = new SCIDoubleRange(0.0, 0.1);

// TextFormatting, Title
xAxis.TextFormatting = "%.02f";
yAxis.TextFormatting = "%.02f";
xAxis.AxisTitle = "XAxis Title";
yAxis.AxisTitle = "YAxis Title";

// Allow configuring of alignment. Axis may be placed at left, right, bottom or top
xAxis.AxisAlignment = SCIAxisAlignment.Bottom;
yAxis.AxisAlignment = SCIAxisAlignment.Left;

// Add the axis to the chart
scs.XAxes.Add(xAxis);
scs.YAxes.Add(yAxis);