ChartPalette
Defines a series color palette for RadChartBase.
Each entry overrides the color for its slot index. Unset indices fall through
to the theme token default (TelerikChartColor{1..6}).
Definition
Namespace:Telerik.Maui.Controls.Charts
Assembly:Telerik.Maui.Controls.dll
Syntax:
public sealed class ChartPalette : StyleableElement
Inheritance: objectChartPalette
Constructors
Initializes a new, empty instance of the ChartPalette class. Populate Entries after construction to define the palette's colors.
public ChartPalette()
Initializes a new instance of the ChartPalette class and populates it with one
ChartPaletteEntry per color in fillColors, in the same order, leaving
each entry's StrokeColor unset.
public ChartPalette(Color[] fillColors)
An array of fill colors to populate the palette entries. If null, the resulting palette is empty.
Properties
Gets the observable collection of color entries that make up this palette. Add, remove, or replace entries at run time to update the palette; changes automatically trigger a chart redraw for any chart currently using this palette.
public ObservableCollection<ChartPaletteEntry> Entries { get; }
Methods
Resolves the fill color to use for the series or slice occupying the given palette slot.
public Color GetFillColor(int index, Color themeDefault)
The zero-based palette slot index, typically the position of a series within Series.
themeDefaultColorThe color to return when index is out of range or the
corresponding entry does not specify a FillColor.
Color
The entry's FillColor if set and index is
within range of Entries; otherwise, themeDefault.
Resolves the stroke color to use for the series or slice occupying the given palette slot.
public Color GetStrokeColor(int index, Color themeDefault)
The zero-based palette slot index, typically the position of a series within Series.
themeDefaultColorThe color to return when index is out of range or the
corresponding entry does not specify a StrokeColor.
Color
The entry's StrokeColor if set and index is
within range of Entries; otherwise, themeDefault.