AnnotationCollection.AddTextAnnotation() Method

Appends the specified TextAnnotation object to the current collection.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v20.2.dll

Declaration

public TextAnnotation AddTextAnnotation()
Public Function AddTextAnnotation As TextAnnotation

Returns

Type Description
TextAnnotation

A TextAnnotation object representing the text annotation to be added.

Remarks

This method adds a TextAnnotation object with the default settings to the annotations collection of a chart, pane or series point.

To add a text annotation with the specified options, use the overloaded AddTextAnnotation methods with the name and text parameters.

After an annotation is added to an element's collection, it can be accessed via the corresponding property of this element (ChartControl.Annotations, XYDiagramPaneBase.Annotations, or SeriesPoint.Annotations). Alternatively, to centrally access all annotations that are present in a chart control, use the ChartControl.AnnotationRepository property.

When you use the AddTextAnnotation method to add annotations to the XYDiagramPaneBase.Annotations or SeriesPoint.Annotations collections, this automatically anchors the annotation to the pane or the series point (the annotation's AnchorPoint property is initialized with a PaneAnchorPoint or SeriesPointAnchorPoint object).

For more information, refer to Annotations.

See Also