Xceed Chart for WinForms v4.4 Documentation
Numeric Scale

Welcome to Xceed Chart for WinForms v4.4 > User Guide > Axes > Scaling > Numeric Scale

Numeric scale mode is the default scale mode of the PrimaryY and SecondaryY chart axes (for details, see StandardAxis Enumeration). When operating in this mode, the axes are scaled to fit the data contained in the data series of the series for the respective chart dimension. 

The properties of the numeric scale are controlled through an instance of the AxisScaleNumeric class, which is accessible through the NumericScale property of the Axis class. The AxisScaleNumeric class is a direct descendant of the AxisScaleValue class and inherits all its functionality. It also implements control over the following aspects of a numeric scale.

Controlling Major Tick Generation in Numeric Scale Mode

The user can control the mode in which the major ticks are generated using the MajorTickMode property, which is of type MajorTickModeNumeric and can accept the following values (for details, see MajorTickModeNumeric Enumeration): 

Manual
Auto

CustomStep

IrregularSteps
 

The following is a description of these modes:

VB.NET  

Dim axis As Axis =   Chart.Axis(StandardAxis.PrimaryY)

axis.ScaleMode = AxisScaleMode.Numeric

axis.NumericScale.MajorTickMode = MajorTickModeNumeric.Manual

axis.MajorTicks.Clear()

axis.MajorTicks.Add(10)

axis.MajorTicks.Add(15)

axis.MajorTicks.Add(25)

C#  

Axis axis = Chart.Axis(StandardAxis.PrimaryY);
axis.ScaleMode = AxisScaleMode.Numeric;
axis.NumericScale.MajorTickMode = MajorTickModeNumeric.Manual;
axis.MajorTicks.Clear();
axis.MajorTicks.Add(10);
axis.MajorTicks.Add(15);
axis.MajorTicks.Add(25);

VB.NET  

axis.NumericScale.MajorTickMode = MajorTickModeNumeric.Auto

axis.NumericScale.MaxTickCount = 10

C#  

axis.NumericScale.MajorTickMode = MajorTickModeNumeric.Auto;
axis.NumericScale.MaxTickCount = 10;

 
VB.NET  

axis.NumericScale.MajorTickMode = MajorTickModeNumeric.CustomStep

axis.NumericScale.CustomStep = 20

C#  

axis.NumericScale.MajorTickMode = MajorTickModeNumeric.CustomStep;
axis.NumericScale.CustomStep = 20;

 
VB.NET  

axis.NumericScale.MajorTickMode = MajorTickModeNumeric.IrregularSteps

axis.NumericScale.CustomSteps.Clear()

axis.NumericScale.CustomSteps.Add(10)

axis.NumericScale.CustomSteps.Add(20)

axis.NumericScale.CustomSteps.Add(15)

C#  

axis.NumericScale.MajorTickMode = MajorTickModeNumeric.IrregularSteps;
axis.NumericScale.CustomSteps.Clear();
axis.NumericScale.CustomSteps.Add(10);
axis.NumericScale.CustomSteps.Add(20);
axis.NumericScale.CustomSteps.Add(15);

 

Demonstration of the Numeric Major Tick Modes
Manual (uses the Series Values) Auto (Step is auto calculated)
Custom Step (in this case 21) Irregular Steps (6, 10, 15)
 

Controlling Scale Origin in Numeric Scale Mode

The scale origin is a value, which if contained in the axis scale range is always displayed with a tick mark. By default the numeric scale uses 0 as its origin. 

Two properties of the numeric scale give you control over the scale origin. The first one, UseOrigin, specifies whether an origin should be used. If you set this property to false, ticks will begin at the min value displayed by the axis. The second one, Origin, specifies the actual origin value and is by default set to 0. It is valid only if the UseOrigin property is set to true. The following code displays the axis with the origin at 2.5:

VB.NET  

axis.NumericScale.UseOrigin = True

axis.NumericScale.Origin = 2.5

C#  
axis.NumericScale.UseOrigin = true;
axis.NumericScale.Origin = 2.5;

Related Examples

Windows Forms: Axes\Scaling\Numeric Scale

See Also

Axis Scales | Axis | AxisScale | AxisScaleValue | AxisScaleNumeric