Palette in UWP Pivot Chart (SfPivotChart)

10 May 20211 minute to read

A pre-defined collection or a set of colors can be applied to the chart series. Palette can be used to provide a rich look for your business applications.

Built-in palette

The SfPivotChart supports the following 12 types of built-in chart palette:

  • Metro
  • AutumnBrights
  • FloraHues
  • Pineapple
  • TomatoSpectrum
  • RedChrome
  • PurpleChrome
  • BlueChrome
  • GreenChrome
  • Elite
  • SandyBeach
  • LightCandy

The following code snippet shows how to apply the palette to the SfPivotChart control.

PivotChart1.ColorPalette = PivotChartColorPalette.AutumnBrights;
PivotChart1.ColorPalette = PivotChartColorPalette.AutumnBrights


Custom palette

The SfPivotChart provides a custom option to define own color brushes with your preferred order for the palette. Using the CustomBrushes property of the SfPivotChart, you can add a collection of colors to series as shown in the following code snippet.

PivotChart1.ColorPalette = PivotChartColorPalette.Custom;
PivotChart1.CustomBrushes = new List<Brush>();
PivotChart1.CustomBrushes.Add(new SolidColorBrush(Colors.BlueViolet));
PivotChart1.CustomBrushes.Add(new SolidColorBrush(Colors.Violet));
PivotChart1.CustomBrushes.Add(new SolidColorBrush(Colors.DarkViolet));
PivotChart1.CustomBrushes.Add(new SolidColorBrush(Colors.LightBlue));
PivotChart1.ColorPalette = PivotChartColorPalette.Custom
PivotChart1.CustomBrushes = New List(Of Brush)()
PivotChart1.CustomBrushes.Add(New SolidColorBrush(Colors.BlueViolet))
PivotChart1.CustomBrushes.Add(New SolidColorBrush(Colors.Violet))
PivotChart1.CustomBrushes.Add(New SolidColorBrush(Colors.DarkViolet))
PivotChart1.CustomBrushes.Add(New SolidColorBrush(Colors.LightBlue))