Skip to main content

Annotations

  • 3 minutes to read

This topic describes how to create and customize annotations, and anchor them to various chart elements. It also explains the general functionality of annotations.

You can create text and image annotations. To do this, create instances of the TextAnnotation and ImageAnnotation classes, respectively.

You can access, manage and customize all annotations created in a chart control from its WebChartControl.AnnotationRepository property.

You can also access annotations quickly at design time. To do this, click the chart control’s smart tag, and then select Annotations… in the ChartControl Tasks list (see the image 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 use the ChartAnchorPoint.X and ChartAnchorPoint.Y properties to adjust the annotation’s position on the chart surface by specifying its distance from the chart’s left and top edges.

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 the following help topic: 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 the following help topic: 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 the following help topic: How to: Create a Text Annotation Anchored to a Series Point.

See Also