Axis.Enabled 属性


获取或设置一个指示是否启用轴的值。Gets or sets a value that indicates whether an axis is enabled.

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


一个 AxisEnabled 枚举值。An AxisEnabled enumeration value. 默认值为 AutoThe default value is Auto.



如果未启用轴, 则不会显示轴及其属性 (刻度线、带状线、标签等)。If an axis is not enabled, the axis, along with its attributes (tick marks, strip lines, labels, and so forth), will not be displayed.

如果启用了轴, 则无论是否正在使用轴绘制Series, 都将显示轴及其所有属性 (刻度线、带状线、标签等)。If an axis is enabled, the axis, along with all its attributes (tick marks, strip lines, labels, and so forth), will be displayed regardless of whether or not it is being used to plot a Series.

如果使用的Auto值, 则可能会显示轴, 也可能不显示轴, 这取决于它是否用于Series绘制。If a value of Auto is used, an axis may or may not be displayed, depending on whether it is being used to plot a Series. 用于绘制数据的轴由XAxisTypeYAxisType属性设置确定。The axes that are used to plot data are determined by the XAxisType and YAxisType property settings.


如果未启用轴, 但相邻轴使用网格线, 则将显示其中一条网格线来代替未启用的轴。If an axis is not enabled but an adjacent axis is using grid lines, one of those grid lines will be displayed in place of the axis that is not enabled. 如果将轴的Enabled属性设置为Auto, 但轴并未用于绘制数据, 则会出现这种情况; 将改为绘制相邻轴的网格线。The same situation will occur if the Enabled property of an axis is set to Auto, but the axis is not being used to plot data; the grid line of an adjacent axis will be drawn instead.