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

Customize LabelTemplate in ChartSeriesCollection


I have a ChartSeriesCollection and I would like to customize the label for each pieSeries.

I tried something like that :
<chart:ChartAdornmentInfo ShowLabel="True" LabelTemplate="{StaticResource PieLabelTemplate}" SegmentLabelContent="YValue" />

but it does not works.

I tried from code behind, but don't know how set AdornmentsInfo correctly.

I created in the sample code a DataTemplate (PieLabelTemplate) which I want to link with the AdornmentsInfo.



Attachment: LabelTemplate_fdbbef29.zip

4 Replies

SS Suresh S Syncfusion Team January 9, 2015 10:58 AM UTC

Hi Dario,

Thanks for using Syncfusion products.

To apply adornment template in ViewModel either we can define the DataTemplate in  Application Resources and access it from ViewModel (in code behind) as like below code snippet. 

Code Snippet[C#]:
labelTemplate = App.Current.Resources["PieLabelTemplate"] as DataTemplate;

Otherwise we can create the Adornment template from code behind. We have prepared the sample based on your requirement, please download it from the  below location.

Suresh S

Attachment: LabelTemplate_a27827fb.zip

DQ Dario Quispe January 9, 2015 05:52 PM UTC

Thanks, it works.

But why sometimes labels are outside ? I set LabelPosition = CircularSeriesLabelPosition.Inside.
Is there a other property to force labels stay inside of pie ?



DQ Dario Quispe January 9, 2015 06:00 PM UTC

I update the sample code to show you labels outside.


Attachment: LabelTemplate_412843f5.zip

SS Suresh S Syncfusion Team January 12, 2015 09:02 AM UTC

Hi Dario,


Sorry for the inconvenience caused.


We are able to reproduce the issue “Adornment label positioning outside for pie series”, we have created incident "133896" behalf of you for this reported issue. Our support engineer will assist you through incident under your Direct Trac account. We suggest you to follow up the incident for further reference using your direct trac account.


Our Direct Trac support system can be accessed from the following link:                              




Suresh S

Live Chat Icon For mobile
Up arrow icon