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.

Change color of PieChart in Xamarin.Android

Thread ID:

Created:

Updated:

Platform:

Replies:

119801 Aug 3,2015 10:35 AM Aug 12,2015 01:03 AM Xamarin.Android 5
loading
Tags: SfChart
Mislav Javor
Asked On August 3, 2015 10:35 AM

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;
  

Yuvaraj Palanisamy [Syncfusion]
Replied On August 4, 2015 02:42 AM

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

Mislav Javor
Replied On August 9, 2015 03:16 PM

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.


Yuvaraj Palanisamy [Syncfusion]
Replied On August 10, 2015 12:54 AM

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

Mislav Javor
Replied On August 11, 2015 10:18 AM

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


Yuvaraj Palanisamy [Syncfusion]
Replied On August 12, 2015 01:03 AM

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

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.

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.

;