Class ChartColorModel
This class represents the color model for chart series. Predefined color palette or user defined color palette can be set using this class.
Inheritance
Namespace: Syncfusion.SfChart.XForms
Assembly: Syncfusion.SfChart.XForms.dll
Syntax
public class ChartColorModel : Element, IThemeElement
Examples
SfChart chart = new SfChart();
chart.ColorModel = new ChartColorModel();
Constructors
ChartColorModel()
Initializes a new instance of the ChartColorModel class.
Declaration
public ChartColorModel()
Fields
CustomBrushesProperty
Gets or sets the list of brushes to be used as custom palette. This is a bindable property.
Declaration
public static readonly BindableProperty CustomBrushesProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
CustomGradientColorsProperty
Gets or sets the collection of gradient colors to be used as custom gradient palette. This is a bindable property.
Declaration
public static readonly BindableProperty CustomGradientColorsProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
PaletteProperty
Gets or sets a predefined color palette for the series. This is a bindable property.
Declaration
public static readonly BindableProperty PaletteProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Properties
CustomBrushes
Gets or sets the list of brushes to be used as custom palette. This is a bindable property.
Declaration
public IList<Color> CustomBrushes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<Xamarin.Forms.Color> | This property takes the List of Xamarin.Forms.Color as its value. |
Remarks
This property effects only when we set the Palette
as ChartColorPalette.Custom
.
CustomGradientColors
Gets or sets the collection of custom gradient colors in custom palette. This is a bindable property.
Declaration
public ChartGradientColorCollection CustomGradientColors { get; set; }
Property Value
Type | Description |
---|---|
ChartGradientColorCollection | This property takes the collection of ChartGradientColor as its value. |
Remarks
This property effects only when we set the Palette
as ChartColorPalette.CustomGradient
.
Palette
Gets or sets a predefined color palette for the series. This is a bindable property.
Declaration
public ChartColorPalette Palette { get; set; }
Property Value
Type | Description |
---|---|
ChartColorPalette | This property takes the ChartColorPalette as its value. |
Methods
GetColors(ChartColorPalette)
Returns the System.Collections.ObjectModel.ObservableCollection<> list of colors for specified palette
Declaration
public List<Color> GetColors(ChartColorPalette palette)
Parameters
Type | Name | Description |
---|---|---|
ChartColorPalette | palette | The ChartColorPalette |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Xamarin.Forms.Color> | System.Collections.ObjectModel.ObservableCollection<> List of colors. |
OnBindingContextChanged()
Declaration
protected override void OnBindingContextChanged()