ChartControl.AnnotationItemsSource Property

Gets or sets the collection of objects used to generate annotations.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v21.1.dll


public IEnumerable AnnotationItemsSource { get; set; }

Property Value

Type Description

A collection that is used to generate annotations. The default is null (Nothing in Visual Basic).


The Chart Control can generate its child elements from their ViewModels. This is useful when the application uses the MVVM architecture and the Chart should contain several chart elements that are bound to data. Use the ChartControl.AnnotationItemsSource property to specify the collection the Chart control utilizes to generate annotations. The ChartControl.AnnotationItemTemplate property allows you to define annotation presentation.


If you have more than one template that can be used to render annotations, you can implement custom logic to choose the required template. To do this, derive from the DataTemplateSelector class, implement the SelectTemplate method that returns a template which meets the required condition, and assign it to the ChartControl.AnnotationItemTemplateSelector property.

    <dxc:ChartControl AnnotationItemsSource="{Binding Path=Annotations, Mode=OneTime}" >
        <!-- Other chart settings are skipped. -->
                <dxc:Annotation Content="{Binding Content}">
                            Angle="{Binding Angle}" 
                            ConnectorLength="{Binding ConnectorLength}"/>
                        <dxc:PaneAnchorPoint AxisXCoordinate="{Binding XValue}" 
                                             AxisYCoordinate="{Binding YValue}"/>
See Also