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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Using legend text in Adornments

Thread ID:

Created:

Updated:

Platform:

Replies:

115892 Feb 19,2014 05:38 PM UTC Feb 20,2014 01:31 PM UTC WinRT 2
loading
Tags: Chart
Colin Desmond
Asked On February 19, 2014 05:38 PM UTC

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?

Karthikeyan V [Syncfusion]
Replied On 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:DoughnutSeries.AdornmentsInfo>

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

                    </syncfusion:DoughnutSeries.AdornmentsInfo>

        <DataTemplate x:Key="labelkey">

                <Grid   >

                    <Grid.ColumnDefinitions>

                        <ColumnDefinition></ColumnDefinition>

                        <ColumnDefinition></ColumnDefinition>

                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>

                        <RowDefinition></RowDefinition>

                        <RowDefinition></RowDefinition>

                    </Grid.RowDefinitions>

                    <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>

                </Grid>

            </DataTemplate>

 

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.

 

Thanks,

Karthikeyan V.


Karthikeyan V [Syncfusion]
Replied On February 20, 2014 01:31 PM UTC


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;