Annotation Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- Inheritance
- Derived
Remarks
Annotations are commonly used to comment or elaborate on chart elements such as data points. Annotations can also be used to draw custom shapes.
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. 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:
Set the AxisX, AxisY or both of these annotation properties to the AxisX and AxisY property values of a ChartArea object.
Use the AnchorDataPoint property to anchor the annotation to a data point. In this case, its positioning is automatically calculated.
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.
Constructors
Annotation() |
Initializes a new instance of the Annotation class. This is the parameterless constructor and should not be used. |
Properties
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 |
Gets or sets the offset from the anchor point for the X position of an annotation. |
AnchorOffsetY |
Gets or sets the offset from the anchor point for the Y position of an annotation. |
AnchorX |
Gets or sets the X coordinate to which the annotation is anchored. |
AnchorY |
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 |
Gets or sets the X axis to which an annotation is attached. |
AxisXName |
Gets or sets the name of the X axis to which an annotation is attached. |
AxisY |
Gets or sets the Y axis to which an annotation is attached. |
AxisYName |
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. (Inherited from 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 |
Gets or sets the X coordinate of an annotation. |
Y |
Gets or sets the Y coordinate of the annotation. |
YAxisName |
Gets or sets the name of the Y axis to which an annotation is attached. |
Methods
BeginPlacement() |
Begins the end user placement of an annotation using the mouse. |
BringToFront() |
Brings an annotation to the front of all annotations. |
Dispose() |
Releases the resources used by the ChartElement. (Inherited from ChartElement) |
Dispose(Boolean) |
Releases unmanaged resources and, optionally, managed resources. |
EndPlacement() |
Ends the end user placement of an annotation. |
Equals(Object) |
Determines whether the specified Object is equal to the current ChartElement. (Inherited from ChartElement) |
GetHashCode() |
Returns a hash function for a particular type. (Inherited from ChartElement) |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ResizeToContent() |
Resizes an annotation according to its content size. |
SendToBack() |
Sends an annotation to the back of all the annotations. |
SetAnchor(DataPoint, DataPoint) |
Anchors an annotation to two data points. |
SetAnchor(DataPoint) |
Anchors an annotation to the specified data point. |
ToString() |
Returns a string that represents the current Object. (Inherited from ChartElement) |