Annotation 类

定义

定义所有批注共有的属性和方法。Defines properties and methods common to all annotations. 这是一个抽象类。This is an abstract class.

public ref class Annotation abstract : System::Windows::Forms::DataVisualization::Charting::ChartNamedElement
public abstract class Annotation : System.Windows.Forms.DataVisualization.Charting.ChartNamedElement
type Annotation = class
    inherit ChartNamedElement
Public MustInherit Class Annotation
Inherits ChartNamedElement
继承
派生

注解

批注通常用于注释或详尽图表元素 (如数据点)。Annotations are commonly used to comment or elaborate on chart elements such as data points. 批注还可用于绘制自定义形状。Annotations can also be used to draw custom shapes.

默认情况下, 使用相对坐标定位批注, 其中 (0, 0) 表示左上角, 而 (100100) 表示图表图像的右下角。By default, annotations are positioned using relative coordinates, with (0,0) representing the top-left corner, and (100,100) representing the bottom-right corner of the chart image. 还可以从此相对坐标系统切换到使用轴值的系统。It is also possible to switch from this relative coordinate system to a system that uses axis values. 使用 X 轴和 Y 轴值 (而不是范围为0-100 的值), 轴坐标系统 X 和 Y 表示批注的左上角的位置。With an axis coordinate system, X and Y, which represent the position of the top-left corner of an annotation, are set using X axis and Y axis values, instead of values that range from 0-100.

指定批注的位置和大小时, 有两种使用轴值的方法:There are two ways to use axis values when you specify the position and size of an annotation:

  • ChartArea AxisY将这两个批注属性设置为对象的和属性值。AxisX AxisX AxisYSet the AxisX, AxisY or both of these annotation properties to the AxisX and AxisY property values of a ChartArea object.

  • AnchorDataPoint使用属性将批注定位到数据点。Use the AnchorDataPoint property to anchor the annotation to a data point. 在这种情况下, 将自动计算其位置。In this case, its positioning is automatically calculated.

所有批注都派生自Annotation类, 该类可用于设置对所有Annotation对象通用的属性, 如颜色、位置、锚定等。All annotations are derived from the Annotation class, which can be used to set attributes common to all Annotation objects, such as color, position, anchoring and so forth.

构造函数

Annotation()

初始化 Annotation 类的新实例。Initializes a new instance of the Annotation class. 这是无参数构造函数,不应使用。This is the parameterless constructor and should not be used.

属性

Alignment

获取或设置批注的内容对齐方式。Gets or sets the content alignment of an annotation.

AllowAnchorMoving

获取或设置一个标志,该标志指定是否允许最终用户使用鼠标移动批注定位点。Gets or sets a flag that specifies whether the end user is allowed to move the annotation anchor using a mouse.

AllowMoving

获取或设置一个标志,该标志指定是否允许最终用户使用鼠标移动批注。Gets or sets a flag that specifies whether the end user is allowed to move an annotation using a mouse.

AllowPathEditing

获取或设置一个标志,该标志指定是否允许最终用户使用鼠标移动多边形批注点。Gets or sets a flag that specifies whether the end user is allowed to move the points of a polygon annotation using a mouse.

AllowResizing

获取或设置一个标志,该标志指定是否允许最终用户使用鼠标调整批注的大小。Gets or sets a flag that specifies whether the end user is allowed to resize an annotation using a mouse.

AllowSelecting

获取或设置一个标志,该标志指定是否允许最终用户使用鼠标选择批注。Gets or sets a flag that specifies whether the end user is allowed to select an annotation using a mouse.

AllowTextEditing

获取或设置一个标志,该标志指定当最终用户双击批注中的文本时是否可以编辑这些文本。Gets or sets a flag that specifies whether the text in an annotation may be edited when the end user double clicks the text.

AnchorAlignment

获取或设置批注相对于定位点的对齐方式。Gets or sets the alignment of an annotation to the anchor point.

AnchorDataPoint

获取或设置批注所定位到的数据点。Gets or sets the data point to which an annotation is anchored.

AnchorDataPointName

获取或设置批注所定位到的数据点的名称。Gets or sets the name of a data point to which an annotation is anchored.

AnchorOffsetX

获取或设置批注的 X 位置相对于定位点的偏移量。Gets or sets the offset from the anchor point for the X position of an annotation.

AnchorOffsetY

获取或设置批注的 Y 位置相对于定位点的偏移量。Gets or sets the offset from the anchor point for the Y position of an annotation.

AnchorX

获取或设置批注所定位到的 X 坐标。Gets or sets the X coordinate to which the annotation is anchored.

AnchorY

获取或设置批注所定位到的 Y 坐标。Gets or sets the Y coordinate to which the annotation is anchored.

AnnotationGroup

获取批注所属的组(如果有)。Gets the group, if any, to which the annotation belongs.

AnnotationType

获取或设置批注的类型名称。Gets or sets an annotation's type name.

AxisX

获取或设置批注所附加到的 X 轴。Gets or sets the X axis to which an annotation is attached.

AxisXName

获取或设置批注所附加到的 X 轴的名称。Gets or sets the name of the X axis to which an annotation is attached.

AxisY

获取或设置批注所附加到的 Y 轴。Gets or sets the Y axis to which an annotation is attached.

AxisYName

获取或设置批注所附加到的 Y 轴的名称。Gets or sets the name of the Y axis which an annotation is attached to.

BackColor

获取或设置批注的背景色。Gets or sets the color of an annotation background.

BackGradientStyle

获取或设置批注背景的渐变样式。Gets or sets the gradient style of an annotation background.

BackHatchStyle

获取或设置批注背景的阴影样式。Gets or sets the hatching style of an annotation background.

BackSecondaryColor

获取或设置批注背景的辅助颜色。Gets or sets the secondary color of an annotation background.

Bottom

获取或设置批注位置的下边界。Gets or sets the bottom boundary of an annotation position.

ClipToChartArea

获取或设置批注所剪辑到的图表区域的名称。Gets or sets the name of the chart area to which an annotation is clipped.

Font

获取或设置要用于批注文本的字体。Gets or sets the font to use for the text of an annotation.

ForeColor

获取或设置批注的文本颜色。Gets or sets the text color of an annotation.

Height

获取或设置批注的高度。Gets or sets the height of an annotation.

IsSelected

获取或设置用于确定是否已选择批注的标志。Gets or sets a flag that determines if an annotation is selected.

IsSizeAlwaysRelative

获取或设置一个标志,该标志指定是否始终用相对图表坐标来定义批注的大小。Gets or sets a flag that specifies whether the size of an annotation is always defined in relative chart coordinates.

LineColor

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

LineDashStyle

获取或设置批注的线条样式。Gets or sets the line style of an annotation.

LineWidth

获取或设置批注的线条宽度。Gets or sets the line width of an annotation.

Name

获取或设置批注的唯一名称。Gets or sets the unique name of an annotation.

Right

获取或设置批注的右边界位置。Gets or sets the right boundary position of an annotation.

ShadowColor

获取或设置批注阴影的颜色。Gets or sets the color of an annotation's shadow.

ShadowOffset

获取或设置批注阴影的大小。Gets or sets the size of an annotation's shadow.

SmartLabelStyle

获取或设置批注的智能标签样式。Gets or sets the smart label style of an annotation.

Tag

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

(继承自 ChartElement)
TextStyle

获取或设置批注的文本样式。Gets or sets the text style of an annotation.

ToolTip

获取或设置批注的工具提示文本。Gets or sets the tooltip text for an annotation.

Visible

获取或设置指定批注是否可见的标志。Gets or sets a flag that specifies whether an annotation is visible.

Width

获取或设置批注的宽度(以像素为单位)。Gets or sets the width, in pixels, of an annotation.

X

获取或设置批注的 X 坐标。Gets or sets the X coordinate of an annotation.

Y

获取或设置批注的 Y 坐标。Gets or sets the Y coordinate of the annotation.

YAxisName

获取或设置批注所附加到的 Y 轴的名称。Gets or sets the name of the Y axis to which an annotation is attached.

方法

BeginPlacement()

使最终用户开始使用鼠标放置批注。Begins the end user placement of an annotation using the mouse.

BringToFront()

将某个批注置于所有批注的前面。Brings an annotation to the front of all annotations.

Dispose()

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

(继承自 ChartElement)
Dispose(Boolean)

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

EndPlacement()

使最终用户结束放置批注。Ends the end user placement of an annotation.

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)
ResizeToContent()

根据批注的内容大小调整批注的大小。Resizes an annotation according to its content size.

SendToBack()

将某个批注置于所有批注的后面。Sends an annotation to the back of all the annotations.

SetAnchor(DataPoint)

将某个批注定位到指定的数据点。Anchors an annotation to the specified data point.

SetAnchor(DataPoint, DataPoint)

将某个批注定位到两个数据点。Anchors an annotation to two data points.

ToString()

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

(继承自 ChartElement)

适用于