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

Annotations Overview

  • 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 created in a chart control from its WebChartControl.AnnotationRepository property.

To access annotations quickly at design time, click the chart control’s smart tag, and then select Annotations… in the ChartControl Tasks list, as shown below.

ClickAnnotationsTask

This invokes the Annotations Collection Editor.

ChooseAnnotations

To create an annotation, click the Add button in the annotations editor, select the annotation type in the Choose Annotation Type dialog, and click OK.

The chart control creates an annotation allowing you to customize its layout, appearance and behavior.

AnnotaionOptions

Depending on which anchor point type the Annotation.AnchorPoint property value is set to, you can create text or image annotations anchored to a chart, pane, or series point.

Anchor Point Type

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 WebChartControl.Annotations property.

Then, you can adjust the annotation’s position on the chart 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 does not change when the chart is 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 the PaneAnchorPoint type, the annotation is added to the pane’s collection, returned by its XYDiagramPaneBase.Annotations property.

Then, you can specify the pane to which the annotation should be anchored (from the PaneAnchorPoint.Pane property), and define the axes and their values for the annotation’s anchor point (from 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 the series point to which the annotation should be anchored (from 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.

See Also