BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
<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.
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
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.