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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do you change colors of the segments on a WPF Pie chart?

Thread ID:

Created:

Updated:

Platform:

Replies:

109968 Jul 12,2013 07:10 PM UTC Aug 5,2013 12:58 PM UTC WPF 6
loading
Tags: Chart
Godwin
Asked On July 12, 2013 07:10 PM UTC

From the sample I noticed that the colors come from separate sample dll. Any documentation for this?
 
Thank you,
Godwin

Godwin
Replied On July 15, 2013 07:01 PM UTC

Please can anyone help? I tried to add CustomPalette to the ChartSeries:

<syncfusion:ChartSeries DataSource="{Binding ProductModel}"ColorEach="True" Palette="Custom" BindingPathX="Months" BindingPathsY="Sales">

<syncfusion:ChartStyleModel.CustomPalette>

<x:Array Type='Brush'>

<SolidColorBrush Color='Violet"></SolidColorBrush>

<SolidColorBrush Color='Indigo'></SolidColorBrush>

<SolidColorBrush Color='Blue'></SolidColorBrush>

<SolidColorBrush Color='Green'></SolidColorBrush>

<SolidColorBrush Color='Yellow'></SolidColorBrush>

<SolidColorBrush Color='Orange'></SolidColorBrush>

<SolidColorBrush Color='Red'></SolidColorBrush>

</x:Array>

</syncfusion:ChartStyleModel.CustomPalette>

</syncfusion:ChartSeries>

 

But it says:

Error 1 The attached property 'ChartStyleModel.CustomPalette' is not defined on 'ChartSeries' or one of its base classes. It's already been 3 days an I need some help.

 
Thank you



Vinoth Kumar J [Syncfusion]
Replied On July 16, 2013 09:34 AM UTC

Hi Godwin,

 

Thanks for using Syncfusion products.

 

We have to set the CustomPalette property for the ChartSeries as like in the below codesnippet.

Code Snippet [XAML]:

                  <syncfusion:ChartSeries DataSource="{Binding ProductModel}" ColorEach="True" Palette="Custom" BindingPathX="Months" BindingPathsY="Sales">

                    <syncfusion:ChartSeries.CustomPalette>

                        <x:Array Type='Brush'>

                            <SolidColorBrush Color="Violet"></SolidColorBrush>

                            <SolidColorBrush Color="Indigo"></SolidColorBrush>

                            <SolidColorBrush Color="Blue"></SolidColorBrush>

                            <SolidColorBrush Color="Green"></SolidColorBrush>

                            <SolidColorBrush Color="Yellow"></SolidColorBrush>

                            <SolidColorBrush Color="Orange"></SolidColorBrush>

                            <SolidColorBrush Color="Red"></SolidColorBrush>

                            </x:Array>

                </syncfusion:ChartSeries.CustomPalette>

               </syncfusion:ChartSeries>

 

 Note: We will update the documentation in our next release volume 3 2013.

 

Please let us know if you have any queries.

 

Regards,

Vinoth Kumar J


Godwin
Replied On July 19, 2013 07:14 PM UTC

Hi Vinoth Kumar,
 
Thank you, I am not able to resolve Syncfusion.Windows.Chart.ChartSeries.CustomPalette.
I'm using version 9.403.0.62. Is CustomPalette only available in some newer version?
 
Thank you.

Muneesh Kumar G [Syncfusion]
Replied On July 29, 2013 12:52 PM UTC

Hi GodWin,

Thanks for your update.

We can achieve your requirement (CustomPalette) in  9.403.0.62 version using ColorModel property of ChartArea as in below code snippet.

Code snippet [XAML]: 

 <syncfusion:ChartArea.ColorModel>

 <syncfusion:ChartStyleModel x:Name="AreaColorModel" Palette="Custom">

 <syncfusion:ChartStyleModel.CustomPalette>

 <x:Array Type='Brush'>

 <SolidColorBrush Color="Violet"></SolidColorBrush>

 <SolidColorBrush Color="Indigo"></SolidColorBrush>

 <SolidColorBrush Color="Blue"></SolidColorBrush>

 <SolidColorBrush Color="Green"></SolidColorBrush>

 <SolidColorBrush Color="Yellow"></SolidColorBrush>

 <SolidColorBrush Color="Orange"></SolidColorBrush>

 <SolidColorBrush Color="Red"></SolidColorBrush>

 </x:Array>

 </syncfusion:ChartStyleModel.CustomPalette>

 </syncfusion:ChartStyleModel>

</syncfusion:ChartArea.ColorModel>

 

We have prepared a sample based on this and you can find the sample under the following location:

Please let us know if you have any queries.

Regards,

Muneesh Kumar G.



CS_f50a5a9e.zip

Godwin
Replied On August 1, 2013 04:23 PM UTC

Hi Muneesh, thank you, that worked, however, I did not need to add the array element in there.
 
The next question is, is there a way to bind a specific color to a datasource row with a specific property value?
 
Thank you,
Godwin
 

Muneesh Kumar G [Syncfusion]
Replied On August 5, 2013 12:58 PM UTC

Hi Godwin,

We have analysed your requirements and prepared a sample based on that. Please find the sample from the following location.

Please let us know if you have any queries.

Regards,

Muneesh Kumar G.


CS1_1311b7eb.zip

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

;