Back to Devexpress

PaletteRepository Class

corelibraries-devexpress-dot-xtracharts-8a157a7b.md

latest4.1 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[RuntimeObject]
public class PaletteRepository :
    PaletteListBase,
    IPaletteRepository
vb
<RuntimeObject>
Public Class PaletteRepository
    Inherits PaletteListBase
    Implements IPaletteRepository

The following members return PaletteRepository objects:

LibraryRelated API Members
WinForms ControlsChartControl.IndicatorsPaletteRepository
ChartControl.PaletteRepository
HeatmapControl.PaletteRepository
ASP.NET MVC ExtensionsChartControlSettings.PaletteRepository
ASP.NET Web Forms ControlsWebChartControl.IndicatorsPaletteRepository
WebChartControl.PaletteRepository
.NET Reporting ToolsXRChart.IndicatorsPaletteRepository
XRChart.PaletteRepository

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:

csharp
// 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";
vb
' 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"

Inheritance

Object SortedList PaletteListBase PaletteRepository

See Also

PaletteRepository Members

Appearance Customization

DevExpress.XtraCharts Namespace