CustomLabel 类

定义

表示轴的自定义标签。Represents a custom label for an axis.

public ref class CustomLabel : System::Windows::Forms::DataVisualization::Charting::ChartNamedElement
public class CustomLabel : System.Windows.Forms.DataVisualization.Charting.ChartNamedElement
type CustomLabel = class
    inherit ChartNamedElement
Public Class CustomLabel
Inherits ChartNamedElement
继承

注解

CustomLabel对象存储在CustomLabelsCollection类中, 该类公开CustomLabelsAxis类的属性。CustomLabel objects are stored in the CustomLabelsCollection class, which is exposed as the CustomLabels property of the Axis class.

如果使用CustomLabels属性指定了自定义标签, 则将自动生成第一个标签行的轴标签。Axis labels for the first label row are automatically generated unless custom labels are specified using the CustomLabels property. 如果沿第一个标签行指定自定义标签, 则不会为整个第一行自动生成轴标签。If you specify a custom label along the first label row, no axis labels will be automatically generated for the entire first row.

对于第二个标签行, 只能使用自定义标签。Only custom labels may be used for the second label row.

ToPositionFromPosition属性确定标签适用的轴范围。The ToPosition and FromPosition properties determine the axis range that the label applies to.

通过使用GridTicks属性, 可以为自定义轴标签显示网格线和/或刻度线; 此属性指定是否将在标签范围的中间绘制自定义网格线或刻度线。A grid line and/or tick mark can be displayed for a custom axis label by using the GridTicks property; this property specifies whether a custom grid line or tick mark will be drawn in the middle of the label range.

构造函数

CustomLabel()

创建 CustomLabel 类的新实例。Creates a new instance of the CustomLabel class.

CustomLabel(Double, Double, String, Int32, LabelMarkStyle)

用指定的 fromPositiontoPositiontextlabelRowmarkStyle 参数初始化 CustomLabel 类的新实例。Initializes a new instance of the CustomLabel class with the specified fromPosition, toPosition, text, labelRow, and markStyle parameters.

CustomLabel(Double, Double, String, Int32, LabelMarkStyle, GridTickTypes)

用指定的 fromPositiontoPositiontextlabelRowmarkStylegridTick 参数初始化 CustomLabel 类的新实例。Initializes a new instance of the CustomLabel class with the specified fromPosition, toPosition, text, labelRow, markStyle and gridTick parameters.

属性

Axis

获取此 CustomLabel 对象所属的轴。Gets the axis that this CustomLabel object belongs to.

ForeColor

获取或设置自定义标签的文本颜色。Gets or sets the text color of the custom label.

FromPosition

获取或设置自定义标签在轴坐标中的开始位置。Gets or sets the beginning position, in axis coordinates, of the custom label.

GridTicks

获取或设置一个属性,该属性指定是否将在标签的中心绘制自定义刻度线和网格线。Gets or sets a property that specifies whether custom tick marks and grid lines will be drawn in the center of the label.

Image

获取或设置自定义标签图像。Gets or sets the custom label image.

ImageTransparentColor

获取或设置在绘制自定义标签图像时,将替换为透明色的颜色。Gets or sets a color that will be replaced with a transparent color when a custom label image is drawn.

LabelMark

获取或设置自定义标签的标签标记。Gets or sets the label mark for a custom label. 这适用于除第一行以外的行中的标签。This applies to labels in rows other than the first row.

MarkColor

获取或设置自定义标签的标记颜色。Gets or sets the marker color for the custom label.

Name

获取或设置自定义标签的名称。Gets or sets the name of the custom label.

RowIndex

获取或设置自定义标签行的索引。Gets or sets the index of the custom label row.

Tag

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

(继承自 ChartElement)
Text

获取或设置自定义标签文本。Gets or sets the custom label text.

ToolTip

获取或设置自定义标签工具提示文本。Gets or sets the custom label tooltip text.

ToPosition

获取或设置自定义标签在轴坐标中的起始位置。Gets or sets the starting position of the custom label, in axis coordinates.

方法

Clone()

返回克隆的标签对象。Returns a cloned label object.

Dispose()

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

(继承自 ChartElement)
Dispose(Boolean)

释放由 ChartElement 占用的非托管资源,还可以另外再释放托管资源。Releases the unmanaged resources used by the ChartElement and optionally releases the managed resources.

(继承自 ChartElement)
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)
GetType()

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

(继承自 Object)
MemberwiseClone()

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

(继承自 Object)
ToString()

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

(继承自 ChartElement)

适用于