corelibraries-devexpress-dot-xtracharts-907290e4.md
A palette (a collection of entries with two colors) that is used to draw a chart with the current appearance settings.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
[RuntimeObject]
public class Palette :
CollectionBase,
IPalette,
ICloneable
<RuntimeObject>
Public Class Palette
Inherits CollectionBase
Implements IPalette,
ICloneable
The following members return Palette objects:
Show 57 links
A palette is a collection of palette entries. Each palette entry is an instance of the PaletteEntry class and contains two colors (PaletteEntry.Color and PaletteEntry.Color2). These colors are used to draw chart elements with different appearance settings (gradient, hatch fill, and so on). To specify the appearance, use the ChartControl.AppearanceName property.
Use the ChartControl.PaletteName property to specify the chart palette. Available palettes are listed in the Palettes class as public static properties.
You can also create a custom palette. To do this, create a Palette object and use the PaletteRepository.RegisterPalette method to add the object to the ChartControl.PaletteRepository.
The following example shows how to create a palette, register the palette, and apply it to a chart:
// Create a palette.
Palette palette = new Palette("Custom Palette");
palette.Add(Color.Yellow);
palette.Add(Color.Red);
palette.Add(Color.Green);
// Register the palette.
chartControl1.PaletteRepository.RegisterPalette(palette);
// Assign the palette to the chart.
chartControl1.PaletteName = "Custom Palette";
' Create a palette.
Dim palette As Palette = New Palette("Custom Palette")
palette.Add(Color.Yellow)
palette.Add(Color.Red)
palette.Add(Color.Green)
' Register the palette.
chartControl1.PaletteRepository.RegisterPalette(palette)
' Assign the palette to the chart.
chartControl1.PaletteName = "Custom Palette"
Object CollectionBase Palette DefaultPalette
See Also