[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Collapse]Chart Control
   [Expand]Getting Started
   [Expand]Charting Basics
   [Expand]Series Views
   [Expand]Chart Elements
   [Collapse]Providing Data
     Create a Series Manually
     Manually Add Points to a Series
     Specify Series Data Members
     Generate Series from a Data Source
     Integration with a Data Grid, Vertical Grid, Tree List or List Box via ControlRowSource
     Pivot Charting (Integration with a Pivot Grid Control)
     Series Scale Types
     Series Colorizer
     Drill Down
   [Expand]Data Representation
   [Expand]Appearance Customization
   [Expand]End-User Features
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Additional Resources
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Series Colorizer

The Series Colorizer provides the capability to assign a color to automatically generated series using one of the predefined algorithms.

This guide consists of the following sections:

Note that Series Colorizers color series whose view represent them as an element, for example a line or area. Series Colorizers paint this element and provide series points' default color. Use Series Point Colorizers to provide custom colors to series points.

Expanded Series Colorizer Setting at Design-Time

To change the series colorizer at design-time, select the chart, expand the ChartControl.SeriesTemplate property in the Properties window, locate the SeriesTemplate.SeriesColorizer property and select the colorizer from the drop-down list.

You can configure the selected colorizer, for example, specify keys that the Key-Color Colorizer should use to assign colors to series. Refer to the Predefined Series Colorizers section to learn more about the predefined colorizers' options.

Expanded Series Colorizer Setting at Runtime

The following code snippet demonstrates how to assign the series colorizer at runtime:

The code above uses the following classes and properties:

Symbol Description
SeriesTemplate.SeriesColorizer Gets or sets the Series Colorizer that automatically paints series.
SeriesColorizerBase The base class for all colorizers.

Refer to the Predefined Series Colorizers section to learn more about the predefined colorizers and their options.

Expanded Predefined Series Colorizers

The chart control has the following predefined colorizers:

  • SeriesKeyColorColorizer

    This colorizer uses the series data member values as color keys to assign colors to series. It is useful then the chart can display multiple series and each series should have a fixed color.

    The following code demonstrates how to configure the colorizer:


    When the colorizer starts painting series and its Keys collection is empty, the colorizer fills this collection using the unique series data member values.

    The code above uses the following properties:

    Property Description
    SeriesKeyColorColorizer.PaletteName Gets or sets the name of the palette whose colors the colorizer assigns to series.
    SeriesKeyColorColorizer.Keys Returns the collection of keys that the colorizer uses to assign colors to series.
    SeriesKeyColorColorizer.KeyProvider Gets or sets the object that converts series data member values into series keys.
  • SeriesDataSourceColorizer

    This colorizer uses objects from a data source to paint series. These objects can be an integer representing an ARGB color, a string that is the color name or a System.Drawing.Color object.

    The code below shows how to customize the colorizer.


    The main data source mentioned in the code snippet is the series template's data source.

    The code snippet uses the following properties:

    Property Description
    SeriesDataSourceColorizer.DataSource Gets or sets the data source whose data items the colorizer uses to paint series.
    SeriesDataSourceColorizer.SeriesKeyMember Gets or sets the name of data member whose values represent colors in which the colorizer paints series.
    SeriesDataSourceColorizer.SeriesColorMember Gets or sets the name of a data member whose values are used as series identifiers.

Expanded Custom Series Colorizers Implementation

The following code demonstrates how to implement a custom colorizer that should paint series using non-predefined algorithm.:

Each series colorizes should inherit the abstract SeriesColorizerBase class that declares the SeriesColorizerBase.GetSeriesColor method that returns a color that corresponds to the specified series key (the series data member value).

Is this topic helpful?​​​​​​​