ScaleGridOptionsBase.GridSpacing Property

Gets or sets the interval between grid lines and major tickmarks.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v20.1.dll

Declaration

[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public double GridSpacing { get; set; }
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Property GridSpacing As Double

Property Value

Type Description
Double

The interval between grid lines and major tickmarks, in units specified by the NumericScaleOptions.GridAlignment (DateTimeScaleOptions.GridAlignment or TimeSpanScaleOptions.GridAlignment.

Property Paths

You can access this nested property as listed below:

Show 79 property paths
Object Type Path to GridSpacing
Axis
.NumericScaleOptions.GridSpacing
Axis
.DateTimeScaleOptions.GridSpacing
Axis
.TimeSpanScaleOptions.GridSpacing
Axis2D
.NumericScaleOptions.GridSpacing
Axis2D
.DateTimeScaleOptions.GridSpacing
Axis2D
.TimeSpanScaleOptions.GridSpacing
Axis3D
.NumericScaleOptions.GridSpacing
Axis3D
.DateTimeScaleOptions.GridSpacing
Axis3D
.TimeSpanScaleOptions.GridSpacing
AxisBase
.NumericScaleOptions.GridSpacing
AxisBase
.DateTimeScaleOptions.GridSpacing
AxisBase
.TimeSpanScaleOptions.GridSpacing
AxisX
.NumericScaleOptions.GridSpacing
AxisX
.DateTimeScaleOptions.GridSpacing
AxisX
.TimeSpanScaleOptions.GridSpacing
AxisX
AxisX3D
.NumericScaleOptions.GridSpacing
AxisX3D
.DateTimeScaleOptions.GridSpacing
AxisX3D
.TimeSpanScaleOptions.GridSpacing
AxisX3D
AxisXBase
.NumericScaleOptions.GridSpacing
AxisXBase
.DateTimeScaleOptions.GridSpacing
AxisXBase
.TimeSpanScaleOptions.GridSpacing
AxisXBase
AxisY
.NumericScaleOptions.GridSpacing
AxisY
.DateTimeScaleOptions.GridSpacing
AxisY
.TimeSpanScaleOptions.GridSpacing
AxisY3D
.NumericScaleOptions.GridSpacing
AxisY3D
.DateTimeScaleOptions.GridSpacing
AxisY3D
.TimeSpanScaleOptions.GridSpacing
AxisYBase
.NumericScaleOptions.GridSpacing
AxisYBase
.DateTimeScaleOptions.GridSpacing
AxisYBase
.TimeSpanScaleOptions.GridSpacing
GanttAxisX
.NumericScaleOptions.GridSpacing
GanttAxisX
.DateTimeScaleOptions.GridSpacing
GanttAxisX
.TimeSpanScaleOptions.GridSpacing
GanttAxisX
PolarAxisX
.NumericScaleOptions.GridSpacing
PolarAxisX
.DateTimeScaleOptions.GridSpacing
PolarAxisX
.TimeSpanScaleOptions.GridSpacing
PolarAxisX
RadarAxis
.NumericScaleOptions.GridSpacing
RadarAxis
.DateTimeScaleOptions.GridSpacing
RadarAxis
.TimeSpanScaleOptions.GridSpacing
RadarAxisX
.NumericScaleOptions.GridSpacing
RadarAxisX
.DateTimeScaleOptions.GridSpacing
RadarAxisX
.TimeSpanScaleOptions.GridSpacing
RadarAxisX
RadarAxisY
.NumericScaleOptions.GridSpacing
RadarAxisY
.DateTimeScaleOptions.GridSpacing
RadarAxisY
.TimeSpanScaleOptions.GridSpacing
SecondaryAxisX
.NumericScaleOptions.GridSpacing
SecondaryAxisX
.DateTimeScaleOptions.GridSpacing
SecondaryAxisX
.TimeSpanScaleOptions.GridSpacing
SecondaryAxisX
SecondaryAxisY
.NumericScaleOptions.GridSpacing
SecondaryAxisY
.DateTimeScaleOptions.GridSpacing
SecondaryAxisY
.TimeSpanScaleOptions.GridSpacing
SwiftPlotDiagramAxis
.NumericScaleOptions.GridSpacing
SwiftPlotDiagramAxis
.DateTimeScaleOptions.GridSpacing
SwiftPlotDiagramAxis
.TimeSpanScaleOptions.GridSpacing
SwiftPlotDiagramAxisX
.NumericScaleOptions.GridSpacing
SwiftPlotDiagramAxisX
.DateTimeScaleOptions.GridSpacing
SwiftPlotDiagramAxisX
.TimeSpanScaleOptions.GridSpacing
SwiftPlotDiagramAxisXBase
.NumericScaleOptions.GridSpacing
SwiftPlotDiagramAxisXBase
.DateTimeScaleOptions.GridSpacing
SwiftPlotDiagramAxisXBase
.TimeSpanScaleOptions.GridSpacing
SwiftPlotDiagramAxisY
.NumericScaleOptions.GridSpacing
SwiftPlotDiagramAxisY
.DateTimeScaleOptions.GridSpacing
SwiftPlotDiagramAxisY
.TimeSpanScaleOptions.GridSpacing
SwiftPlotDiagramAxisYBase
.NumericScaleOptions.GridSpacing
SwiftPlotDiagramAxisYBase
.DateTimeScaleOptions.GridSpacing
SwiftPlotDiagramAxisYBase
.TimeSpanScaleOptions.GridSpacing
SwiftPlotDiagramSecondaryAxisX
.NumericScaleOptions.GridSpacing
SwiftPlotDiagramSecondaryAxisX
.DateTimeScaleOptions.GridSpacing
SwiftPlotDiagramSecondaryAxisX
.TimeSpanScaleOptions.GridSpacing
SwiftPlotDiagramSecondaryAxisY
.NumericScaleOptions.GridSpacing
SwiftPlotDiagramSecondaryAxisY
.DateTimeScaleOptions.GridSpacing
SwiftPlotDiagramSecondaryAxisY
.TimeSpanScaleOptions.GridSpacing

Remarks

This feature manages label placement along the axis. By default, the ScaleGridOptionsBase.AutoGrid is true, and the GridSpacing is set automatically. If you wish to change the step interval for axis labeling, specify the interval between grid alignment units by the GridSpacing property value.

It is important to note that the GridSpacing and ScaleGridOptionsBase.AutoGrid properties are interdependent - changing the value of one property affects the value of the other.

The following images demonstrate how the GridSpacing property works.

AutoGrid = true;

(auto) GridSpacing=1;

(auto) GridAlignment="Week";

(auto) MeasureUnit="Day";

AutoGrid = false;

GridSpacing=3;

GridAlignment="Day";

MeasureUnit="Day";

GridSpacing_Auto

GridSpacing_1

NOTE

If the AxisBase.Logarithmic scale is enabled, the GridSpacing property value is rounded to integer values. Note that since GridSpacing can't be set to 0, if its value is less than 1 (e.g., 0.1) it is always rounded to 1.

For more information, refer to Axis Scale Types.

Examples

This example shows how to use NumericScaleOptions to reduce the number of visible series points.

Result

The following code configures the axis scale settings to resemble to the chart appearance above:

NumericScaleOptions numericScaleOptions = ((XYDiagram)chartControl.Diagram).AxisX.NumericScaleOptions;

numericScaleOptions.ScaleMode = ScaleMode.Manual;
numericScaleOptions.MeasureUnit = NumericMeasureUnit.Hundreds;
numericScaleOptions.GridOffset = 5;
numericScaleOptions.AggregateFunction = AggregateFunction.Average;
numericScaleOptions.GridAlignment = NumericGridAlignment.Thousands;
numericScaleOptions.GridSpacing = 1;

The following table lists the API members the code above uses:

Member Description
AxisBase.NumericScaleOptions Stores the options that define the behavior of a scale when its type is numeric.
ScaleOptionsBase.ScaleMode Gets or sets the scale mode for an axis.
ScaleMode Lists the values that specify the scale mode for an axis.
NumericScaleOptions.MeasureUnit Gets or sets the detail level for numeric values.
NumericMeasureUnit Lists the values that specify the detail level for numeric values.
ScaleGridOptionsBase.GridOffset Gets or sets the offset of grid lines and major tickmarks.
ScaleGridOptionsBase.AggregateFunction Gets or sets the value indicating the aggregate function that should be used to relieve data.
AggregateFunction Lists the values that specify the aggregate function used for an axis.
NumericScaleOptions.GridAlignment Gets or sets the numeric measure unit to which the beginning of an axis' gridlines and labels should be aligned.
NumericGridAlignment Lists the values that specify the numeric-time measurement unit, to which the beginning of a diagram's gridlines and labels should be aligned.
ScaleGridOptionsBase.GridSpacing Gets or sets the interval between grid lines and major tickmarks.
See Also