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

How can i make customization Doughtnut chart slice as i want color

Thread ID:





145891 Jul 12,2019 07:18 AM UTC Jul 15,2019 07:29 AM UTC Xamarin.Forms 1
Tags: SfChart
Mahmut Nedim
Asked On July 12, 2019 07:18 AM UTC

I want to change colors of the slices as I want as follows. How can i add another property for color in ChartDataModel and how can i make binding. Thank u

Rachel A [Syncfusion]
Replied On July 15, 2019 07:29 AM UTC

Hi Mahmut, 
Greetings from Syncfusion. 
We can achieve this requirement by setting custom palette to series with the required colors. Also, have prepared a sample based on the requirement and it can download from the below link. 
Please find the code snippet below to achieve the same. 
    <chart:DoughnutSeries ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue" > 
            <chart:ChartColorModel Palette="Custom" CustomBrushes="{Binding Colors}" /> 
public class ViewModel 
    public ChartColorCollection Colors { get; set; } 
    public ViewModel() 
        Colors = new ChartColorCollection(); 
Please refer below user documentation to know more details about custom palette.   
Please let us know if you have any queries.   


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon