Skip to main content
A newer version of this page is available. .

Annotations

  • 3 minutes to read

This document describes how annotations can be created, anchored to various chart elements and customized, and illustrates their general functionality.

Two different annotation types are available: text and image annotations (represented by the TextAnnotation and ImageAnnotation class instances, respectively).

You can access, manage and customize all annotations that are present in a chart control, via its ChartControl.AnnotationRepository property. At design time, access it quickly via the chart control’s smart tag.

Annotations_0

Annotations can be created for a chart, pane, or series point.

The Annotation.AnchorPoint property value determines to which element’s collection an annotation is added.

The anchor point type

The example image

Description

Chart Anchoring

AnnotationAnchoring_Chart

If the Annotation.AnchorPoint property is set to a ChartAnchorPoint type, the annotation is added to the chart’s collection, returned by its ChartControl.Annotations property.

Then, you can adjust the annotations position on the chart’s surface, by specifying its distance from the chart’s left and top edges, via the ChartAnchorPoint.X and ChartAnchorPoint.Y properties.

These coordinates position an annotation absolutely, meaning that the anchor point doesn’t change when a chart is being resized.

For a step-by-step tutorial, refer to How to: Create an Image Annotation Anchored to a Chart or Pane.

Pane Anchoring

AnnotationAnchoring_Pane

If the Annotation.AnchorPoint property is set to a PaneAnchorPoint type, the annotation is added to the pane’s collection, returned by its XYDiagramPaneBase.Annotations property.

Then, you can specify to which particular pane the annotation is anchored (via the PaneAnchorPoint.Pane property), and define the axes and their values for the annotation’s anchor point (via the PaneAnchorPoint.AxisXCoordinate and PaneAnchorPoint.AxisYCoordinate properties).

If the pane, to which an annotation is anchored, is removed, the annotation is removed, as well.

For a step-by-step tutorial, refer to How to: Create an Image Annotation Anchored to a Chart or Pane.

Series Point Anchoring

AnnotationAnchoring_Point

If the Annotation.AnchorPoint property is set to a SeriesPointAnchorPoint type, the annotation is added to the point’s collection, returned by its SeriesPoint.Annotations property.

Then, you can specify to which particular series point the annotation is anchored (via the SeriesPointAnchorPoint.SeriesPoint property).

If the series point, to which an annotation is anchored, is removed, the annotation is removed, as well.

For a step-by-step tutorial, refer to How to: Create a Text Annotation Anchored to a Series Point.

After annotation anchoring, the position of the annotation can be specified. For more information about positioning and layout, refer to the Annotations Position and Layout document.

Besides, the annotations appearance is deeply customizable. Refer to the Annotations Appearance topic to learn more.