Axis.IntervalType 属性


获取或设置轴的间隔类型。Gets or sets the interval type of an axis.

 property System::Windows::Forms::DataVisualization::Charting::DateTimeIntervalType IntervalType { System::Windows::Forms::DataVisualization::Charting::DateTimeIntervalType get(); void set(System::Windows::Forms::DataVisualization::Charting::DateTimeIntervalType value); };
public System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType IntervalType { get; set; }
member this.IntervalType : System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType with get, set
Public Property IntervalType As DateTimeIntervalType


DateTimeIntervalType,表示轴的间隔类型。A DateTimeIntervalType that represents the interval type of an axis. 默认值为 AutoThe default value is Auto.



如果轴元素自己的 IntervalType 属性值设置为 NotSet,则此属性将确定轴的间隔类型,并用于轴标签、主要刻度线或主要网格线的间隔类型。This property determines the interval type of an axis, and is used for the interval type of an axis' labels, major tick marks, or major grid lines if the axis element's own IntervalType property value is set to NotSet.

将此属性设置为 NotSet 会导致使用 Auto 值。Setting this property to NotSet will result in a value of Auto being used. 只有轴元素(例如网格线)可以设置为 NotSetOnly the axis elements, such as grid lines, can be set to NotSet.

注意轴的次要网格线和刻度线决不会将此属性用于其间隔类型。Note The minor grid lines and tick marks of an axis never use this property for their interval type.

轴的间隔由 Interval 属性确定。The interval of the axis is determined by the Interval property.


如果轴间隔类型由时间(如小时数、分钟数等)表示,则为了使缩放功能正确无误,还必须将 IntervalType 设置为时间值。If the axis interval type is represented by a time such as hours, minutes, and so forth, then in order for zooming to function correctly, the IntervalType must be set to a time value as well. 例如,如果 ChartArea1 设置为 hours,则 ChartArea1. CursorX 可以设置为分钟。For example, if ChartArea1.AxisX.IntervalType is set to hours, then ChartArea1.CursorX.IntervalType could be set to minutes.