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.

TIP

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E2188.

To create an annotation anchored to a series point, do the following.

  1. Create a chart with a Bar series.
  2. Click the chart's smart tag, and in its actions list, click Annotations... link.

    Annotations_0

  3. In the invoked Annotation Collection Editor, click Add, and then double-click the Text Annotation type.

    Annotations_1

  4. For the created annotation, click the ellipsis button for its Annotation.AnchorPoint property.

    Annotations_2

  5. Then, choose the Series Point Anchor Point type.

    Annotations_3

  6. And, choose the series point to which the annotation is anchored.

    Annotations_4

  7. 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.

Annotations_5

See Also