Skip to main content

AnnotationCollection.AddImageAnnotation(String, String) Method

Appends the specified ImageAnnotation object to the current collection.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.2.dll

Declaration

public ImageAnnotation AddImageAnnotation(
    string name,
    string imageUrl
)

Parameters

Name Type Description
name String

A String value which specifies the name of the annotation.

imageUrl String

A String value which specifies an URL to the annotation’s image.

Returns

Type Description
ImageAnnotation

An ImageAnnotation object representing the image annotation to be added.

Remarks

Use the AddImageAnnotation method to create an image annotation within a WebChartControl. For a ChartControl, use the overloaded AddImageAnnotation method with the image parameter.

After an annotation is added to an element’s collection, it can be accessed via the corresponding property of this element (ChartControl.Annotations, XYDiagramPaneBase.Annotations, or SeriesPoint.Annotations). Alternatively, to centrally access all annotations that are present in a chart control, use the ChartControl.AnnotationRepository property.

When you use the AddImageAnnotation method to add annotations to the XYDiagramPaneBase.Annotations or SeriesPoint.Annotations collections, this automatically anchors the annotation to the pane or the series point (the annotation’s AnchorPoint property is initialized with a PaneAnchorPoint or SeriesPointAnchorPoint object).

For more information, refer to Annotations.

See Also