Skip to main content

PaletteRepository Class

Represents the repository used to store the palettes that are used to draw the elements of a chart control.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v23.2.dll

NuGet Package: DevExpress.Charts

Declaration

[RuntimeObject]
public class PaletteRepository :
    PaletteListBase,
    IPaletteRepository

Remarks

A PaletteRepository stores different palettes that 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.

Example

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";

Inheritance

See Also