This documentation is archived and is not being maintained.

Grid.Interval Property

Gets or sets the interval between major or minor grid lines.

Namespace:  System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)

public double Interval { get; set; }

Property Value

Type: System.Double
A double value that represents the interval between grid lines. By default, the value is not set (NaN) for major grid lines. For minor grid lines, the default value is zero (0).

By default this property is not set for axis labels, major tick marks and major grid lines. If it is not set—either by default, by explicitly using NotSet at design time, or by assigning a value of NaN at run time—the actual value of this property is determined by the Interval property of the Axis object to which the chart element, such as a grid line or tick mark, belongs.

The interval of minor tick marks and grid lines is never affected by the Interval property value.

The interval is measured in axis units, and determines how often an applicable chart element is drawn. For example, suppose a column chart has an X axis step of 1 (that is, 1, 2, 3, 4, and so forth); if you set the Interval property for the X axis to 2, an axis label will be displayed for every other column.

The same holds true for all applicable chart elements. In other words, if in the previous example strip lines were being used, with an IntervalOffset of 0.5, and their Interval property was 2, a strip line would be displayed at 0.5, 2.5, 4.5, and so on.

If you set a chart element Interval property to zero, an interval will be automatically determined by the Chart control.

.NET Framework

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.