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

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

6 Replies

GO Godwin 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




VK Vinoth Kumar J Syncfusion Team 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



GO Godwin 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.


MK Muneesh Kumar G Syncfusion Team 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


GO Godwin 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
 


MK Muneesh Kumar G Syncfusion Team 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

Loader.
Up arrow icon