We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Using legend text in Adornments

I am trying to create a doughnut series graph without a legend (to save space), so I want to use the text that normally appears in the legend in the Adornments. I can get the XValue and YValue to appear, but not the text. How do I do this?

2 Replies

KV Karthikeyan V Syncfusion Team February 20, 2014 01:30 PM UTC

Hi Colin,


Thank you for using Syncfusion products.


We have analysed the reported query. You can achieve your requirement by setting the SegmentLabelContent property as LabelContentPath and overriding the Label Template in AdornmentInfo.


Code snippet [XAML]:



                    <syncfusion:ChartAdornmentInfo ShowLabel="True" SegmentLabelContent="LabelContentPath" LabelTemplate="{StaticResource labelkey}"  />


        <DataTemplate x:Key="labelkey">

                <Grid   >









                    <TextBlock  Text="XValue   |" Margin="5" Grid.Row="0" Grid.Column="0"></TextBlock>

                    <TextBlock  Text="{Binding Item.ProductName}" Margin="5" Grid.Row="0" Grid.Column="1"></TextBlock>

                    <TextBlock  Text="YValue   |" Grid.Row="1" Margin="5" Grid.Column="0"></TextBlock>

                    <TextBlock  Text="{Binding YData}" Margin="5" Grid.Row="1" Grid.Column="1"></TextBlock>




We have prepared a sample based on this. You can download sample under the following location.


Please let us know if you require further assistance on this.



Karthikeyan V.

KV Karthikeyan V Syncfusion Team February 20, 2014 01:31 PM UTC

Live Chat Icon For mobile
Up arrow icon