Series Point Colorizers

  • 5 minutes to read

The chart control uses colorizers to paint series points. This topic lists available colorizer types and explains how to apply them to a chart.

Bubble series points painted by a colorizer

Follow the steps below to apply a colorizer to series points:

  1. Bind the series to a data source. For more information, refer to the following help topic: Bind a Series to a Data Source.

  2. Create one of the following colorizers:

  3. Configure the colorizer’s settings and assign it to the Series.Colorizer property.

  4. Specify the series’s ColorDataMember property to set a data source field that is used to determine point colors.

The color that a colorizer calculates for a series point is assigned to the SeriesPoint.Brush property. You can handle the ChartControl.BoundDataChanged event to access the chart diagram’s series collection and the resulting colors of individual series points.

If the chart control aggregates series data, the aggregated point has the color that mostly occurs on the aggregated interval.

For line and area series, a colorizer calculates colors only for point markers. If you want to paint the line or the area itself, use segment colorizers.

Color Object Colorizer

The ColorObjectColorizer applies a color to a series point that is stored in the defined data field associated with the point. Use the ColorDataMember property to specify the data field name. This data field can store colors in different formats:

  • 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

The following example shows how to apply colors from a data source to series points:

A chart with a color object colorizer applied

    mc:Ignorable="d" Title="MainWindow" Height="640" Width="1350">
        <dxc:ChartControl DataSource="{Binding Data}">
            <!-- ... -->
                <dxc:BarSideBySideSeries2D ArgumentDataMember="Argument" 
                <!-- ... -->
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Media;

namespace ChartSample {
    public partial class MainWindow : Window {
        public MainWindow() {
    public class MainWindowViewModel {
        public ObservableCollection<DataPoint> Data { get; private set; }
        public MainWindowViewModel() {
            this.Data = DataPoint.GetDataPoints();
    public class DataPoint {
        public string Argument { get; set; }
        public double Value { get; set; }
        public object Color { get; set; }
        public static ObservableCollection<DataPoint> GetDataPoints() {
            return new ObservableCollection<DataPoint> {
                    new DataPoint { Argument = "Alabama",     Value = 17383, Color = Colors.MediumOrchid },
                    new DataPoint { Argument = "California",  Value = 17779, Color = "SkyBlue" },
                    new DataPoint { Argument = "Florida",     Value = 18327, Color = Brushes.DarkSeaGreen },
                    new DataPoint { Argument = "Arizona",     Value = 16957, Color = "#fc0" },
                    new DataPoint { Argument = "Colorado",    Value = 19039, Color = "#ffof" },
                    new DataPoint { Argument = "Connecticut", Value = 17360, Color = "#ff005d" },
                    new DataPoint { Argument = "Georgia",     Value = 17491, Color = "#ff20b2aa" },
                    new DataPoint { Argument = "Idaho",       Value = 18801, Color = -32944 }

Key-Color Colorizer

The KeyColorColorizer applies colors to series points based on key values (keys) associated with the points. Points with equal keys have the same color. Populate the Keys collection with key values to specify the order in which the palette colors are assigned to keys. You should use values from a data source field that specifies ColorDataMember. If the Keys collection is empty, colors are applied to series points in the order keys have in the data source.

The following example shows how to paint series points by key values:

A chart with a key-color colorizer applied

View Example

<dxc:BarSideBySideSeries2D DisplayName="GDP" 
                           DataSource="{Binding XPath=/G20HPIs/CountryStatistics}"
                           ArgumentDataMember="Country" ValueDataMember="Product"

You can also specify the KeyColorColorizer.KeyProvider property to calculate keys based on custom logic.

Range Colorizer

The RangeColorizer applies colors based on ranges to which series point values belong. Use the RangeColorizer.RangeStops property to specify color boundaries.

A chart with a range colorizer applied

<dxc:BarSideBySideSeries2D DataSource="{Binding Data}"
        <dxc:RangeColorizer RangeStops="40 45 50 55 60 65 70" 
                            LegendTextPattern="{}{V1} - {V2}">

If you want to distribute colors based on custom values, specify the RangeColorizer.ValueProvider property.