Back to Devexpress

ColorDataAdapter Class

maui-devexpress-dot-maui-dot-charts-ab45df7a.md

latest2.5 KB
Original Source

ColorDataAdapter Class

Retrieves point colors and their legend item descriptions from data source fields.

Namespace : DevExpress.Maui.Charts

Assembly : DevExpress.Maui.Charts.dll

NuGet Package : DevExpress.Maui.Charts

Declaration

csharp
public class ColorDataAdapter :
    DataSourceAdapterBase,
    ICustomPointColorizer,
    IPointColorizer,
    ILegendItemProvider

Remarks

You can specify a series point colorizer based on colors stored in a data source. To do this:

  1. Assign a ColorDataAdapter object to the PointColorizer property of a series.
  2. Use the adapter’s properties to define the data source and its fields that contain point colors and their text descriptions for legend items.

Example

In this example, the bar chart visualizes GDP values for the G20 and paints bars with colors from the specified field of the data source. Legend items obtain descriptions for these colors from another field.

  1. Create a data source – a list of objects each of which stores a country’s name, GDP value, region (the part of the world where the country is located), and color for this region.

  2. Set the BarSeries.PointColorizer property to a ColorDataAdapter object with the following properties specified:

Implements

INotifyPropertyChanged

IChangeableSeriesData

IDisposable

ICustomPointColorizer

IPointColorizer

ILegendItemProvider

Inheritance

System.Object BindableObject DataSourceAdapterBase ColorDataAdapter

Extension Methods

Yield<ColorDataAdapter>()

YieldIfNotNull<ColorDataAdapter>()

See Also

ColorDataAdapter Members

DevExpress.Maui.Charts Namespace