ScaleGridOptionsBase.AutoGrid Property

Gets or sets the value specifying whether the alignment, spacing and offset of grid lines and major tickmarks should be calculated automatically.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v19.2.dll

Declaration

[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public bool AutoGrid { get; set; }
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Property AutoGrid As Boolean

Property Value

Type Description
Boolean

true, if grid spacing is performed automatically; otherwise, false.

Remarks

The AutoGrid property is tightly interrelated with the ScaleGridOptionsBase.GridSpacing, ScaleGridOptionsBase.GridOffset and NumericScaleOptions.GridAlignment(DateTimeScaleOptions.GridAlignment) properties. Changing the value of one property affects the other. By default, the AutoGrid property is set to true and the grid line spacing is calculated automatically.

The following images demonstrate how the AutoGrid property works.

AutoGrid = true;

(auto) GridAlignment = Week;

(auto) GridSpacing = 1;

AutoGrid = false;

GridAlignment = Day;

GridSpacing = 3;

GridSpacing_Auto

GridSpacing_1

Note that if you need to define a custom grid interval, change the value of the ScaleGridOptionsBase.GridSpacing, ScaleGridOptionsBase.GridOffset or NumericScaleOptions.GridAlignment(DateTimeScaleOptions.GridAlignment) property. This automatically sets the AutoGrid property to false.

For more information, refer to Axis Scale Types.

Example

Use AxisBase.NumericScaleOptions, AxisBase.DateTimeScaleOptions, AxisBase.TimeSpanScaleOptions or AxisXBase.QualitativeScaleOptions to access the AutoGrid property.

NumericScaleOptions xAxisOptions = ((XYDiagram)chartControl1.Diagram).AxisX.NumericScaleOptions;
xAxisOptions.AutoGrid = true;
See Also