Export (0) Print
Expand All

Annotation Class

Defines properties and methods common to all annotations. This is an abstract class.

Namespace:  System.Windows.Forms.DataVisualization.Charting
Assembly:  System.Windows.Forms.DataVisualization (in System.Windows.Forms.DataVisualization.dll)

public abstract class Annotation : ChartNamedElement

The Annotation type exposes the following members.

  NameDescription
Protected methodAnnotationInitializes a new instance of the Annotation class. This is the default constructor and should not be used.
Top

  NameDescription
Public propertyAlignmentGets or sets the content alignment of an annotation.
Public propertyAllowAnchorMovingGets or sets a flag that specifies whether the end user is allowed to move the annotation anchor using a mouse.
Public propertyAllowMovingGets or sets a flag that specifies whether the end user is allowed to move an annotation using a mouse.
Public propertyAllowPathEditingGets or sets a flag that specifies whether the end user is allowed to move the points of a polygon annotation using a mouse.
Public propertyAllowResizingGets or sets a flag that specifies whether the end user is allowed to resize an annotation using a mouse.
Public propertyAllowSelectingGets or sets a flag that specifies whether the end user is allowed to select an annotation using a mouse.
Public propertyAllowTextEditingGets or sets a flag that specifies whether the text in an annotation may be edited when the end user double clicks the text.
Public propertyAnchorAlignmentGets or sets the alignment of an annotation to the anchor point.
Public propertyAnchorDataPointGets or sets the data point to which an annotation is anchored.
Public propertyAnchorDataPointNameInfrastructure. Gets or sets the name of a data point to which an annotation is anchored.
Public propertyAnchorOffsetXGets or sets the offset from the anchor point for the X position of an annotation.
Public propertyAnchorOffsetYGets or sets the offset from the anchor point for the Y position of an annotation.
Public propertyAnchorXGets or sets the X coordinate to which the annotation is anchored.
Public propertyAnchorYGets or sets the Y coordinate to which the annotation is anchored.
Public propertyAnnotationGroupInfrastructure. Gets the group, if any, to which the annotation belongs.
Public propertyAnnotationTypeInfrastructure. Gets or sets an annotation's type name.
Public propertyAxisXGets or sets the X axis to which an annotation is attached.
Public propertyAxisXNameInfrastructure. Gets or sets the name of the X axis to which an annotation is attached.
Public propertyAxisYGets or sets the Y axis to which an annotation is attached.
Public propertyAxisYNameInfrastructure. Gets or sets the name of the Y axis which an annotation is attached to.
Public propertyBackColorGets or sets the color of an annotation background.
Public propertyBackGradientStyleGets or sets the gradient style of an annotation background.
Public propertyBackHatchStyleGets or sets the hatching style of an annotation background.
Public propertyBackSecondaryColorGets or sets the secondary color of an annotation background.
Public propertyBottomGets or sets the bottom boundary of an annotation position.
Public propertyClipToChartAreaGets or sets the name of the chart area to which an annotation is clipped.
Public propertyFontGets or sets the font to use for the text of an annotation.
Public propertyForeColorGets or sets the text color of an annotation.
Public propertyHeightGets or sets the height of an annotation.
Public propertyIsSelectedGets or sets a flag that determines if an annotation is selected.
Public propertyIsSizeAlwaysRelativeGets or sets a flag that specifies whether the size of an annotation is always defined in relative chart coordinates.
Public propertyLineColorGets or sets the line color of an annotation.
Public propertyLineDashStyleGets or sets the line style of an annotation.
Public propertyLineWidthGets or sets the line width of an annotation.
Public propertyNameGets or sets the unique name of an annotation. (Overrides ChartNamedElement.Name.)
Public propertyRightGets or sets the right boundary position of an annotation.
Public propertyShadowColorGets or sets the color of an annotation's shadow.
Public propertyShadowOffsetGets or sets the size of an annotation's shadow.
Public propertySmartLabelStyleGets or sets the smart label style of an annotation.
Public propertyTagGets or sets an object associated with this chart element. (Inherited from ChartElement.)
Public propertyTextStyleGets or sets the text style of an annotation.
Public propertyToolTipGets or sets the tooltip text for an annotation.
Public propertyVisibleGets or sets a flag that specifies whether an annotation is visible.
Public propertyWidthGets or sets the width, in pixels, of an annotation.
Public propertyXGets or sets the X coordinate of an annotation.
Public propertyYGets or sets the Y coordinate of the annotation.
Public propertyYAxisNameInfrastructure. Gets or sets the name of the Y axis to which an annotation is attached.
Top

  NameDescription
Public methodBeginPlacementBegins the end user placement of an annotation using the mouse.
Public methodBringToFrontBrings an annotation to the front of all annotations.
Public methodDispose()Releases the resources used by the ChartElement. (Inherited from ChartElement.)
Protected methodDispose(Boolean)Releases unmanaged resources and, optionally, managed resources. (Overrides ChartElement.Dispose(Boolean).)
Public methodEndPlacementEnds the end user placement of an annotation.
Public methodEqualsDetermines whether the specified Object is equal to the current ChartElement. (Inherited from ChartElement.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns a hash function for a particular type. (Inherited from ChartElement.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodResizeToContentResizes an annotation according to its content size.
Public methodSendToBackSends an annotation to the back of all the annotations.
Public methodSetAnchor(DataPoint)Anchors an annotation to the specified data point.
Public methodSetAnchor(DataPoint, DataPoint)Anchors an annotation to two data points.
Public methodToStringReturns a string that represents the current Object. (Inherited from ChartElement.)
Top

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.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft