Export (0) Print
Expand All

Annotation Class

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

Namespace:  System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)

public abstract class Annotation : ChartNamedElement, 
	IChartMapArea

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 propertyAnchorAlignmentGets or sets the position 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, in which the annotation belongs to.
Public propertyAnnotationTypeInfrastructure. Gets or sets the type name of an annotation.
Public propertyAxisXGets or sets the X axis to which an annotation is attached.
Public propertyAxisXNameInfrastructure. Gets or sets the name of the X axis which an annotation is attached to.
Public propertyAxisYGets or sets the Y axis which an annotation is attached to.
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 propertyMapAreaAttributesGets or sets the map area attributes of an annotation.
Public propertyNameGets or sets the unique name of an annotation. (Overrides ChartNamedElement.Name.)
Public propertyPostBackValueGets or sets the postback value which can be processed on the Click event.
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 propertyUrlGets or sets the URL of 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 which an annotation is attached to.
Top

  NameDescription
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 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, 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