Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Configure the Appearance of an Annotation

This example demonstrates how to customize the annotation content appearance.

<dxc:ChartControl.Annotations>
    <dxc:Annotation Margin="10">
        <dxc:Annotation.Content>
            <local:TextAndImage Text="Mars" 
                                ImageSource="Images/Mars.png"/>
        </dxc:Annotation.Content>
        <dxc:Annotation.ContentTemplate>
            <DataTemplate>
                <StackPanel Orientation="Vertical">
                    <Image Width="32" 
                           Height="32"
                           Source="{Binding ImageSource}"/>
                    <TextBlock HorizontalAlignment="Center"
                               Text="{Binding Text}"/>
                </StackPanel>
            </DataTemplate>
        </dxc:Annotation.ContentTemplate>
        <dxc:Annotation.AnchorPoint>
            <dxc:ChartAnchorPoint X="30" 
                                  Y="30"/>
        </dxc:Annotation.AnchorPoint>
        <dxc:Annotation.ShapePosition>
            <dxc:FreePosition HorizontalAlignment="Left"
                              VerticalAlignment="Top"/>
        </dxc:Annotation.ShapePosition>
    </dxc:Annotation>
</dxc:ChartControl.Annotations>