Axis 类

定义

提供管理 Chart 控件中的轴的方法和属性。Provides methods and properties that manage axes in the Chart control.

public ref class Axis : System::Web::UI::DataVisualization::Charting::ChartNamedElement, System::Web::UI::DataVisualization::Charting::IChartMapArea
public class Axis : System.Web.UI.DataVisualization.Charting.ChartNamedElement, System.Web.UI.DataVisualization.Charting.IChartMapArea
type Axis = class
    inherit ChartNamedElement
    interface IChartMapArea
Public Class Axis
Inherits ChartNamedElement
Implements IChartMapArea
继承
实现

注解

Chart此类封装控件中轴的所有功能, AxisXChartArea对象的、 AxisY AxisX2AxisY2属性公开。This class encapsulates all the functionality for axes in the Chart control, and is exposed by the AxisX, AxisY, AxisX2 and AxisY2 properties of ChartArea objects.

对于所有图表 (条形图、堆积条形图、饼图和圆环图除外), 主要轴和辅助轴如下:For all charts - except bar, stacked bar, pie and doughnut - the primary and secondary axes are as follows:

轴类型Axis Type 说明Description
主 X 轴Primary X-Axis 底部水平轴。Bottom horizontal axis.
辅助 X 轴Secondary X-Axis 顶部水平轴。Top horizontal axis.
主 Y 轴Primary Y-Axis 左垂直轴。Left vertical axis.
辅助 Y 轴Secondary Y-Axis 右垂直轴。Right vertical axis.

条形图和堆积条形图的轴顺时针旋转了90度, 因此这两种图表类型的主 X 轴是左垂直轴。Bar and stacked-bar charts have their axes rotated 90 degrees clockwise, so the primary X axis for these two chart types is the left-vertical axis.

注意每个ChartArea对象只能有一组轴-两个垂直和两个水平。Note There can be only one set of axes - two vertical and two horizontal - for each ChartArea object.

Axis类还包含若干方法, 这些方法可用于将轴值转换为绝对像素坐标, 这对于2d 自定义绘图或相对坐标非常有用, 这对于3d 自定义绘图很有用。The Axis class also contains several methods that can be used to convert axis values to absolute pixel coordinates, which are useful for 2D custom drawing, or to relative coordinates, which are useful for 3D custom drawing. 绝对和相对坐标也可以转换为轴值。Absolute and relative coordinates can also be converted to axis values.

下面是Axis类公开的最重要的轴元素:The following are the most important axis elements exposed by the Axis class:

Axis 元素Axis Element 说明Description
轴标签Axis Labels 轴的标签及其相关属性。The labels of an axis, and their associated properties.
网格线Grid Lines 轴的主要网格线和次要网格线。The major and minor grid lines of an axis.
刻度线Tick Marks 轴的主要刻度线和次要刻度线。The major and minor tick marks of an axis.
条带线Strip Lines 条带线。Strip lines.

构造函数

Axis()

初始化 Axis 类的新实例。Initializes a new instance of the Axis class.

Axis(ChartArea, AxisName)

使用指定的 ChartAreaaxisTypeName 值初始化 Axis 类的新实例。Initializes a new instance of the Axis class with the specified ChartArea and axisTypeName values.

属性

ArrowStyle

获取或设置二维 (2-D) 轴的箭头样式;此样式不适用于三维 (3-D) 图表区域。Gets or sets the arrow style of a two-dimensional (2D) axis; this style is not applied to three-dimensional (3D) chart areas.

AxisName

获取轴的名称,可以是 X、Y、X2 或 Y2。Gets the name of the axis, which can be either X, Y, X2 or Y2.

Crossing

获取或设置某个轴与其关联轴相交叉的位置。Gets or sets the location at which an axis is crossed by its associated axis.

CustomLabels

获取用于存储 CustomLabelsCollection 对象的 CustomLabel 对象。Gets a CustomLabelsCollection object used to store CustomLabel objects.

Enabled

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

InterlacedColor

获取或设置交错带状线的颜色。Gets or sets the color of interlaced strip lines.

Interval

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

IntervalAutoMode

获取或设置一个标志,该标志确定是在轴上使用固定数目的间隔,还是根据轴的大小确定间隔数。Gets or sets a flag that determines if a fixed number of intervals is used on the axis, or if the number of intervals depends on the axis size.

IntervalOffset

获取或设置轴的间隔偏移量。Gets or sets the interval offset of an axis.

IntervalOffsetType

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

IntervalType

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

IsInterlaced

获取或设置确定是否为轴显示交错带状线的标志。Gets or sets a flag that determines if interlaced strip lines are displayed for an axis.

IsLabelAutoFit

获取或设置确定是否自动调整轴标签的标志。Gets or sets a flag that determines whether axis labels are automatically fitted.

IsLogarithmic

获取或设置指示相应轴是否为对数轴的标志。Gets or sets a flag which indicates whether the axis is logarithmic. 对数图表中不允许出现零或负的数据值。Zeros or negative data values are not allowed on logarithmic charts.

IsMarginVisible

获取或设置可确定是否使用轴边距的标志。Gets or sets a flag that determines whether an axis margin will be used.

IsMarksNextToAxis

获取或设置一个标志,该标志确定在轴的交叉点更改时,刻度线和轴标签是否随轴一起移动。Gets or sets a flag that determines whether tick marks and axis labels move with an axis if the crossing point of an axis changes.

IsReversed

获取或设置指示是否将轴反转的标志。Gets or sets a flag which indicates whether the axis is reversed.

IsStartedFromZero

获取或设置一个标志,该标志指示在所有数据点值均为正值时是否将轴的最小值自动设置为零。Gets or sets a flag which indicates whether the minimum value of the axis will be automatically set to zero if all data point values are positive. 如果存在负数据点值,则将使用数据点的最小值。If there are negative data point values, the minimum value of the data points will be used.

LabelAutoFitMaxFontSize

获取或设置标签自动调整算法可以使用的最大字号。Gets or sets the maximum font size that can be used by the label auto-fitting algorithm.

LabelAutoFitMinFontSize

获取或设置标签自动调整算法可以使用的最小字号。Gets or sets the minimum font size that can be used by the label auto-fitting algorithm.

LabelAutoFitStyle

获取或设置允许的标签更改,这些更改可用于使标签能够沿轴进行调整。Gets or sets the allowable label changes that can be made to enable the label to be fit along an axis.

LabelStyle

获取或设置轴的 LabelStyle 属性。Gets or sets the LabelStyle properties of an axis.

LineColor

获取或设置轴的线条颜色。Gets or sets the line color of an axis.

LineDashStyle

获取或设置轴的线型。Gets or sets the line style of an axis.

LineWidth

获取或设置轴的线条宽度(以像素为单位)。Gets or sets the line width of an axis, in pixels.

LogarithmBase

获取或设置用于对数轴的对数底的值。Gets or sets a value for the logarithm base for the logarithmic axis.

MajorGrid

获取或设置用于设置轴的主要网格线属性的 Grid 对象。Gets or sets a Grid object used to set the major grid line properties for an axis.

MajorTickMark

获取或设置用于设置轴的主要刻度线属性的 TickMark 对象。Gets or sets a TickMark object used to set the major tick mark properties of an axis.

MapAreaAttributes

获取或设置轴的映射区特性。Gets or sets the map area attributes of an axis.

Maximum

获取或设置轴的最大值。Gets or sets the maximum value of an axis.

MaximumAutoSize

获取或设置轴的最大大小(以图表区域的百分比形式表示)。Gets or sets the maximum size of the axis, measured as a percentage of the chart area. 此值由自动布局算法使用。This value is used by the automatic layout algorithm.

Minimum

获取或设置轴的最小值。Gets or sets the minimum value of an axis.

MinorGrid

获取或设置用于指定轴的次要网格线特性的 Grid 对象。Gets or sets a Grid object used to specify the minor grid lines attributes of an axis.

MinorTickMark

获取或设置用于设置轴的次要刻度线属性的 TickMark 对象。Gets or sets a TickMark object used to set the minor tick mark properties of an axis.

Name

获取或设置轴的名称。Gets or sets the name of the axis.

PostBackValue

获取或设置在发生 Click 事件时,可以处理的回发值。Gets or sets the postback value that can be processed on a Click event.

ScaleBreakStyle

获取或设置轴的自动刻度分隔样式。Gets or sets the axis automatic scale break style.

ScaleView

获取或设置轴的视图。Gets or sets the view of an axis.

StripLines

获取一个 StripLinesCollection 集合对象,该对象存储了轴的所有 StripLine 对象。Gets a StripLinesCollection collection object, which stores all StripLine objects for an axis.

Tag

获取或设置与此图表元素关联的对象。Gets or sets an object associated with this chart element.

(继承自 ChartElement)
TextOrientation

获取或设置轴标题中文本的方向。Gets or sets the orientation of the text in the axis title.

Title

获取或设置轴的标题。Gets or sets the title of the axis.

TitleAlignment

获取或设置轴标题的对齐方式。Gets or sets the alignment of an axis title.

TitleFont

获取或设置轴的标题字体属性。Gets or sets the title font properties of an axis.

TitleForeColor

获取或设置轴标题的文本颜色。Gets or sets the text color of an axis title.

ToolTip

获取或设置用于轴的工具提示。Gets or sets the tooltip used for the axis.

Url

获取或设置轴的目标 URL。Gets or sets the URL target of the axis.

方法

Dispose()

释放由 ChartElement 占用的资源。Releases the resources used by the ChartElement.

(继承自 ChartElement)
Dispose(Boolean)

释放非托管资源和(可选)托管资源。Releases unmanaged and, optionally, managed resources.

Equals(Object)

确定指定的 Object 是否等同于当前的 ChartElementDetermines whether the specified Object is equal to the current ChartElement.

(继承自 ChartElement)
GetHashCode()

返回特定类型的哈希算法。Returns a hash function for a particular type.

(继承自 ChartElement)
GetPosition(Double)

将轴值转换为相对位置 (0-100%)。Converts an axis value to a relative position (0-100%). 如果是对数轴,则将值转换为线性刻度。If an axis is logarithmic, the value is converted to a linear scale.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
PixelPositionToValue(Double)

将沿轴的绝对像素位置转换为轴值。Converts an absolute pixel position along an axis to an axis value. 此方法仅适用于绘制事件。This method only works in paint events.

PositionToValue(Double)

将沿轴的相对坐标转换为轴值。Converts a relative coordinate along an axis to an axis value. 此方法仅适用于绘制事件。This method only works in paint events.

RoundAxisValues()

自动舍入轴值。Automatically rounds axis values.

ToString()

返回表示当前 Object 的字符串。Returns a string that represents the current Object.

(继承自 ChartElement)
ValueToPixelPosition(Double)

将轴值转换为沿轴的绝对坐标。Converts an axis value to an absolute coordinate along an axis. 以像素度量。Measured in pixels. 此方法仅适用于绘制事件。This method only works in paint events.

ValueToPosition(Double)

将轴值转换为其相对位置 (0-100%)。Converts an axis value to its relative position (0-100%). 如果轴具有对数刻度,则该值将转换为线性刻度。If an axis has a logarithmic scale, the value is converted to a linear scale. 此方法仅适用于绘制事件。This method only works in paint events.

适用于