Back to Devexpress

How to: Dock an Annotation to a Chart

wpf-116110-controls-and-libraries-charts-suite-chart-control-examples-chart-elements-how-to-dock-an-annotation-to-a-chart.md

latest886 B
Original Source

How to: Dock an Annotation to a Chart

  • Jun 07, 2019

This example demonstrates how to anchor an annotation to a chart surface point as shown in the following image:

To do this, specify the ChartAnchorPoint.X and ChartAnchorPoint.Y properties.

xaml
<dxc:Annotation Content="Annotation #3">
    <dxc:Annotation.AnchorPoint>
        <dxc:ChartAnchorPoint X="100" 
                              Y="220"/>
    </dxc:Annotation.AnchorPoint>
    <dxc:Annotation.ShapePosition>
        <dxc:RelativePosition ConnectorLength="80" 
                              Angle="-20"/>
    </dxc:Annotation.ShapePosition>
</dxc:Annotation>