Back to Devexpress

Palette Class

corelibraries-devexpress-dot-xtracharts-907290e4.md

latest8.1 KB
Original Source

Palette Class

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

Declaration

csharp
[RuntimeObject]
public class Palette :
    CollectionBase,
    IPalette,
    ICloneable
vb
<RuntimeObject>
Public Class Palette
    Inherits CollectionBase
    Implements IPalette,
               ICloneable

The following members return Palette objects:

Show 57 links

LibraryRelated API Members
Cross-Platform Class LibraryChartPaletteColorizerBase.Palette
HeatmapPaletteColorProvider.Palette
IndicatorsPalettes.GetPalette(String)
PaletteListBase.Item[String]
PaletteRepository.Item[String]
Palettes.Apex
Palettes.Aspect
Palettes.BlackAndWhite
Palettes.Blue
Palettes.BlueGreen
Palettes.BlueWarm
Palettes.Chameleon
Palettes.Civic
Palettes.Concourse
Palettes.Equity
Palettes.Flow
Palettes.Foundry
Palettes.GetPalette(String, IChartContainer)
Palettes.Grayscale
Palettes.Green
Palettes.GreenYellow
Palettes.InAFog
Palettes.Marquee
Palettes.Median
Palettes.Metro
Palettes.Mixed
Palettes.Module
Palettes.NatureColors
Palettes.NorthernLights
Palettes.Office
Palettes.Office2013
Palettes.Opulent
Palettes.Orange
Palettes.OrangeRed
Palettes.Oriel
Palettes.Origin
Palettes.Paper
Palettes.PastelKit
Palettes.Red
Palettes.RedOrange
Palettes.RedViolet
Palettes.Slipstream
Palettes.Solstice
Palettes.Technic
Palettes.TerracottaPie
Palettes.TheTrees
Palettes.Trek
Palettes.Urban
Palettes.Verve
Palettes.Violet
Palettes.VioletII
Palettes.Yellow
Palettes.YellowOrange
RangeSegmentColorizer.Palette
SankeyPaletteColorizer.Palette
SeriesKeyColorColorizer.Palette
WinForms ControlsChartModel.Palette

Remarks

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.

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 CollectionBase Palette DefaultPalette

See Also

Palette Members

DevExpress.XtraCharts Namespace