Skip to main content

Series.ColorDataMember Property

Gets or sets the name of the data member on which the color of a series point is based.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v24.1.dll

NuGet Package: DevExpress.Wpf.Charts


public string ColorDataMember { get; set; }

Property Value

Type Description

A String value that is the name of a data member.


Note when a series template is used to generate series, you need to handle the ChartControl.BoundDataChanged event to set colors for all series when data is changed. To change colors one by one, handle the ChartControl.CustomDrawSeries event.

A data field specified by ColorDataMember can contain different data depending on the colorizer type.

For a ColorObjectColorizer, the data field can store the following values:

  • An integer ARGB color value (431493885)
  • Three, four, six, or eight digit hex code (#fc0, #f00f, #ff005d, #ff32cd32)
  • A string color name (SkyBlue)
  • A Color object
  • A SolidColorBrush object

For a KeyColorColorizer, the data field stores objects that are used as keys. Points with equal keys have the same color.

For a RangeColorizer, the data field stores numeric values. The colorizer determines to which interval the value belongs and assigns the corresponding color to the point.


To use the Color Object Colorizer, do the following.

Create a ColorObjectColorizer object and assign it to the Series.Colorizer property. Additional configuration is not required.


This colorizer is used by default.

View Example

        xmlns:dxc="" x:Class="ColorObjectColorizerExample.MainWindow"
        Title="MainWindow" Height="720" Width="1280">
        <XmlDataProvider x:Key="dataProvider" Source="Data/GDP.xml"/>

    <Grid DataContext="{Binding Source={StaticResource dataProvider}}">
                <dxc:Title Content="GDP for G20" HorizontalAlignment="Center"/>
                <dxc:BarSideBySideSeries2D DisplayName="GDP" 
                                           DataSource="{Binding XPath=/G20HPIs/CountryStatistics}"
                                           ArgumentDataMember="Country" ValueDataMember="Product"

See Also