How to: Create a Text Annotation Anchored to a Series Point
This example demonstrates how to create a text annotation anchored to a series point. For general information, refer to Annotations.
A complete sample project is available in the DevExpress Code Examples database at https://supportcenter.devexpress.com/ticket/details/e2188/chart-for-winforms-how-to-accompany-a-chart-its-pane-or-series-point-by-text-or-image.
To create an annotation anchored to a series point, do the following.
- Create a chart with a Bar series.
Click the chart’s smart tag, and in its actions list, click Annotations… link.
In the invoked Annotation Collection Editor, click Add, and then double-click the Text Annotation type.
For the created annotation, click the ellipsis button for its Annotation.AnchorPoint property.
Then, choose the Series Point Anchor Point type.
And, choose the series point to which the annotation is anchored.
- Now, the annotation has been anchored to that point, and back in the Annotation Collection Editor you can adjust its text (TextAnnotation.Text) and position (Annotation.ShapePosition), as well as its appearance options.
The result is shown in the following image.