Change the Chart X-axis automatic label numbering origin

Applies to: Nevron Chart for .NET

How to change the Chart X-axis automatic label numbering origin?

By default the X-axis automatic label numbering starts from zero (0). The data points will also appear between the X-axis ticks.



The following code snippet shows how to force the x axis to display the axis ticks between the data points and to start the automatic label numbering from 1:

[C#]
NOrdinalScaleConfigurator scaleX = chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as NOrdinalScaleConfigurator;
 
scaleX.LabelStyle.ValueOffset = 1;
//scaleX.DisplayDataPointsBetweenTicks = true;
scaleX.DisplayDataPointsBetweenTicks = false;

[VB.NET]
Dim scaleX As NOrdinalScaleConfigurator = TryCast(chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator, NOrdinalScaleConfigurator)
 
scaleX.LabelStyle.ValueOffset = 1
'scaleX.DisplayDataPointsBetweenTicks = True
scaleX.DisplayDataPointsBetweenTicks = False

Article ID: 221, Created On: 6/19/2012, Modified: 6/19/2012