BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
<chart:SfChart x:Name="AppsChart" AreaBorderThickness="0" ><chart:SfChart.Legend> <chart:ChartLegend DockPosition="Right" CheckBoxVisibility="Visible"/> </chart:SfChart.Legend><chart:SfChart.PrimaryAxis> <chart:CategoryAxis/> </chart:SfChart.PrimaryAxis> <chart:SfChart.SecondaryAxis> <chart:NumericalAxis/> </chart:SfChart.SecondaryAxis> <chart:PieSeries ConnectorType="Line" EnableSmartLabels="true" LabelPosition="OutsideExtended" EnableAnimation="True" x:Name="pieSeries" ShowTooltip="True" chart:ChartTooltip.EnableAnimation="True" ItemsSource="{Binding ViewModel.PieList}" XBindingPath="Name" YBindingPath="Count" Margin="0"> </chart:PieSeries> </chart:SfChart>
Hi Rodolphe,
We have analyzed your requirement and you can manually set Pie segments color by using the property palette as custom for the PieSeries as shown in the below code snippet.
Code Snippet [XAML]:
<chart:PieSeries
Palette="Custom"
XBindingPath="Country" YBindingPath="Count" ItemsSource="{Binding
Data}">
<chart:PieSeries.ColorModel>
<chart:ChartColorModel>
<chart:ChartColorModel.CustomBrushes>
<SolidColorBrush
Color="BlanchedAlmond"></SolidColorBrush>
<SolidColorBrush
Color="CadetBlue"></SolidColorBrush>
<SolidColorBrush
Color="Crimson"></SolidColorBrush>
<SolidColorBrush
Color="Red"></SolidColorBrush>
<SolidColorBrush
Color="DarkGray"></SolidColorBrush>
</chart:ChartColorModel.CustomBrushes>
</chart:ChartColorModel>
</chart:PieSeries.ColorModel>
</chart:PieSeries>
We have prepared a sample based on this and please find the attached sample.
Please let us know if you have any queries.
Thanks,
Mohammed Azarudeen.
Hi Rodolphe,
We have analyzed your requirement and you can able to bind
view model property(with the brushes added to it) to the ColorModel property of
the PieSeries as shown in the below code snippet.
Code Snippet [XAML]:
<chart:PieSeries ConnectorType="Line" ColorModel="{Binding
CustomBrushes, Converter={StaticResource converter}}"
Palette="Custom" XBindingPath="Country"
YBindingPath="Count" ItemsSource="{Binding Data}"
EnableSmartLabels="true"
LabelPosition="OutsideExtended"
EnableAnimation="True" ShowTooltip="True”
chart:ChartTooltip.EnableAnimation="True">
We have prepared a sample based on this and please find the
attached sample.
Please let us know if you have any queries.
Thanks,
Mohammed Azarudeen.