SciChart iOS v2.x API > Axis APIs > Axis Ticks - Major Delta, Minor Delta and AutoTicks
Axis Ticks - Major Delta, Minor Delta and AutoTicks

Axis Ticks, Labels and Grid Lines

In SciChart, the Ticks are small marks around the chart on an axis. There are Minor and Major Ticks, where Minor Ticks are placed in between Major ones. By default, Major Ticks are longer and thicker than Minor Ticks.

Axis Labels appears for every Major Tick, if there is enough space around. If Axis Labels are placed too tightly, some of them get culled to make more space. If necessary, labels culling can be switched off via the isLabelCullingEnabled property.

Grid Lines correspond to Ticks on an axis. Likewise, there are Minor and Major Grid lines. In SciChart, axes are responsible not only for drawing Ticks and Labels, but also for the chart grid. An axis draws only those Grid Lines that can be measured against it, i.e. a horizontal axis draws vertical grid lines and vice versa.

 

To learn more about possible options for Axis Ticks, Gridlines and Labels, please refer to the Styling Gridlines, Ticks and Axis Bands and Styling Title and Axis Labels articles.

Automatic Tick Spacing

In SciChart, the difference between two Major Ticks is called MajorDelta, and that between two minor Ticks - MinorDelta. By default, both delta values(therefore the Tick spacing) are calculated automatically according to the VisibleRange and size of an axis. As zoom level changes, the MajorDelta, MinorDelta of every axis will be updated correspondingly, and the tick frequency may change.

There are two additional options used to control the auto ticking behavior. The maxAutoTicks property allows to limit the number of generated ticks to the desired number, and minorsPerMajor specifies how many Minor Ticks are drawn between two Major Ticks (the default is 5).

SCINumericAxis * axis = [[SCINumericAxis alloc] init];

// Change max possible auto ticks amount. The default is 10
axis.maxAutoTicks = 20;

// Specify that there should be 10 minor ticks between each major tick pair
// The default is 5
axis.minorsPerMajor = 10;
var axis = SCINumericAxis()

// Change max possible auto ticks amount. The default is 10
axis.maxAutoTicks = 20

// Specify that there should be 10 minor ticks between each major tick pair
// The default is 5
axis.minorsPerMajor = 10
var axis = new SCINumericAxis();

// Change max possible auto ticks amount. The default is 10
axis.MaxAutoTicks = 20;

// Specify that there should be 10 minor ticks between each major tick pair
// The default is 5
axis.MinorsPerMajor = 10;

 

Altering Tick Spacing

It is possible to set MinorDelta and MajorDelta manually. To change them, automatic calculation must be switched off via the autoTicks property. To set delta values, call the minorDelta and majorDelta methods. Please note that both delta values need to be set in this case:

 

SCINumericAxis * axis = [[SCINumericAxis alloc] init];

// Switch off automatic delta calculation
axis.autoTicks = false;

// Assign Major, Minor Delta values
axis.majorDelta = 10;
axis.minorDelta = 2;
var axis = SCINumericAxis()

// Switch off automatic delta calculation
axis.autoTicks = false

// Assign Major, Minor Delta values
axis.majorDelta = 10
axis.minorDelta = 2
var axis = new SCINumericAxis();

// Switch off automatic delta calculation
axis.AutoTicks = false;

// Assign Major, Minor Delta values
axis.MajorDelta = 10;
axis.MinorDelta = 2;

 

Altering Tick Spacing for the LogarithmicAxis

SCILogarithmicNumericAxis is a special case that need to be mentioning here. Due to the exponential nature of this axis type, MajorDelta represents the difference between exponents of neighbouring major ticks, not between their actual values. For instance, having MajorDelta = 3 and logarithmicBase = 10 on the axis specifies that major ticks and gridlines will be spaced at 103 intervals (exponents will be divisors of MajorDelta):

 

 

On the contrary, the difference between neighbouring minor ticks is not exponential. Therefore MinorDelta represents the difference between actual values of neighbouring minor ticks. For instance, having MinorDelta = 100 results in minor ticks and gridlines appearing with the increment of 100x10E, where E is the exponent of the nearest major tick to the left. So the interval will be (100x100 = 100) between 1x100 and 1x103, (100x10 = 100 000) between 1x103 and 1x106, and 100x106 between 1x106 and 1x109.

 

See Also