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

Change color of PieChart in Xamarin.Android

I can't seem to find a way to change the color of my PieChart
This is what I have tried:

var colorsList = new List<Java.Lang.Integer>();
colorsList.Add(new Java.Lang.Integer(Color.ParseColor("#00B2B2")));
colorsList.Add(new Java.Lang.Integer(Color.ParseColor("#498FFF")));
colorsList.Add(new Java.Lang.Integer(Color.ParseColor("#61A037")));
colorsList.Add(new Java.Lang.Integer(Color.ParseColor("#B373B3")));
colorsList.Add(new Java.Lang.Integer(Color.ParseColor("#B373B3")));
colorsList.Add(new Java.Lang.Integer(Color.ParseColor("#D16A76")));
colorsList.Add(new Java.Lang.Integer(Color.ParseColor("#F5A523")));
_countriesChart.ColorModel.CustomColors = colorsList;
  

5 Replies

YP Yuvaraj Palanisamy Syncfusion Team August 4, 2015 06:42 AM UTC

Hi Misla,

Thanks for using Syncfusion Products.

We can achieve your requirement by setting ColorPalette property of ColorModel as Custom as shown in the below code snippet.

[c#]

_countriesChart.ColorModel.ColorPalette = ChartColorPalette.Custom;

 
 
Please let us know if you require further assistance on this, we will be happy to assist you.

Thanks,
Yuvaraj


MJ Mislav Javor August 9, 2015 07:16 PM UTC

I have tried that, but it doesn't help... 
I have tried putting it above the code, below the code... I copied and pasted it on dozen different locations.



YP Yuvaraj Palanisamy Syncfusion Team August 10, 2015 04:54 AM UTC

Hi Mislav,

We have prepared a sample for your requirement to apply custom colors as you expected. Please refer the sample from the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/119801/ze/ChartSimpleSample-458809380

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

Thanks,
Yuvaraj


MJ Mislav Javor August 11, 2015 02:18 PM UTC

Hi, your example was helpful. 
I managed to fix everything. However it would be nice to have documentation for these sort of things...



YP Yuvaraj Palanisamy Syncfusion Team August 12, 2015 05:03 AM UTC

Hi Mislav,

Thanks for the update.

We would like to let you know that, currently we are working on UG documentation and it will be published online as soon as possible.

Please let us know if you require further assistance on this we will be happy to assist you.

Thanks,
Yuvaraj

Loader.
Live Chat Icon For mobile
Up arrow icon