Grid.Interval Property

Definition

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

public:
 property double Interval { double get(); void set(double value); };
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.DataVisualization.Charting.AxisElementIntervalValueConverter))]
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.Attribute)]
public double Interval { get; set; }
[<System.ComponentModel.Bindable(true)>]
[<System.ComponentModel.TypeConverter(typeof(System.Web.UI.DataVisualization.Charting.AxisElementIntervalValueConverter))>]
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.Attribute)>]
member this.Interval : double with get, set
Public Property Interval As Double

Property Value

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).

Attributes

Remarks

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.

Applies to