Palettes in WPF Surface Chart (SfSurfaceChart)

Surface chart provides options to apply different kinds of palettes.

Some of the predefined palettes include:

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

Applying Predefined Brushes

Using the above palette you can apply a set of predefined brushes to surface chart as shown in the following code example.

<chart:SfSurfaceChart Palette="Metro" />
SfSurfaceChart chart = new SfSurfaceChart();

chart.Palette = ChartColorPalette.Metro;

Applying Custom Brushes

The custom palette option enables you to define your own color brushes for the Palette using ColorModel property as given in the following code example.

<chart:SfSurfaceChart Palette="Custom" >

	<Syncfusion:SfSurfaceChart.ColorModel>

			<Syncfusion:ChartColorModel>
			
				<Syncfusion:ChartColorModel.CustomBrushes>
				
					<SolidColorBrush Color="Blue"/>	
					
					<SolidColorBrush Color="Lime"/>
					
					<SolidColorBrush Color="Yellow"/>
												
					<SolidColorBrush Color="Blue"/>
												
					<SolidColorBrush Color="Lime"/>
					
					<SolidColorBrush Color="Yellow"/>
					
					<SolidColorBrush Color="OrangeRed"/>
					
				</Syncfusion:ChartColorModel.CustomBrushes>
				
			</Syncfusion:ChartColorModel>
			
	</Syncfusion:SfSurfaceChart.ColorModel>
	   
<chart:SfSurfaceChart />
ChartColorModel colorModel = new ChartColorModel();

colorModel.CustomBrushes.Add(new SolidColorBrush(Colors.Blue));

colorModel.CustomBrushes.Add(new SolidColorBrush(Colors.Lime));

colorModel.CustomBrushes.Add(new SolidColorBrush(Colors.Yellow));

colorModel.CustomBrushes.Add(new SolidColorBrush(Colors.Blue));

colorModel.CustomBrushes.Add(new SolidColorBrush(Colors.Lime));

colorModel.CustomBrushes.Add(new SolidColorBrush(Colors.Yellow));

colorModel.CustomBrushes.Add(new SolidColorBrush(Colors.OrangeRed));

SfSurfaceChart chart = new SfSurfaceChart();

chart.Palette = ChartColorPalette.Custom;

chart.ColorModel = colorModel;