Hi Lakhwinder,
We can achieve your requirement by using the property ColorModel in the Series. Refer to the following code example which shows how to set ColorModel in series.
CodeExample:
SFPieSeries series = new SFPieSeries ();
series.ColorModel.Palette = SFChartColorPalette.Custom;
NSObject[] cusColors = new NSObject[] {UIColor.Blue,UIColor.Green,UIColor.Orange,UIColor.Red,UIColor.Cyan};
series.ColorModel.CustomColors = NSArray.FromNSObjects(cusColors);
series.DataMarker.ShowLabel = true;
return series;
We have prepared a sample based on your requirement. Please find the sample from the following location.
Sample: PieChart
Regards,
Manivannan.E
I did it in XAML:
<chart:PieSeries ItemsSource="{Binding HighTemperature}" >
<chart:PieSeries.ColorModel>
<chart:ChartColorModel Palette="Custom" >
<chart:ChartColorModel.CustomBrushes>
<Color>
Red
</Color>
<Color>
Yellow
</Color>
<Color>
Green
</Color>
</chart:ChartColorModel.CustomBrushes>
</chart:ChartColorModel>
</chart:PieSeries.ColorModel>
<chart:PieSeries.DataMarker>
<chart:ChartDataMarker ShowLabel="True"></chart:ChartDataMarker>
</chart:PieSeries.DataMarker>
</chart:PieSeries>
<chart:PieSeries.ColorModel>
<chart:ChartColorModel Palette=" TomatoSpectrum" >
</chart:PieSeries.ColorModel> |