Skip to main content

SeriesDataSourceColorizer.SeriesColorMember Property

Gets or sets the name of a data member whose values are used as series identifiers.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.1.dll

NuGet Package: DevExpress.Charts

Declaration

[XtraSerializableProperty]
public string SeriesColorMember { get; set; }

Property Value

Type Description
String

The name of a data member whose values are used as series identifiers.

Remarks

The SeriesColorMember field can contain the following values:

  • an integer ARGB color value (431493885)
  • three or six digit hex code (#fc0, #ff005d)
  • a string color name (SkyBlue)
  • a Color object

Example

The code below shows how to customize the colorizer.

Important

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.
class Department {
    public String Name { get; set; }
    public Color Marker { get; set; }
}
// ...
chartControl.SeriesTemplate.SeriesColorizer = new SeriesDataSourceColorizer() {
    // The data source storing objects that contain a series's color.
    DataSource = new List<Department> {
        new Department { Name = "DevAV North", Marker = Color.FromArgb(0xE1, 0x83, 0x35)},
        new Department { Name = "DevAV Europe", Marker = Color.FromArgb(0x1E, 0x91, 0xD6)},
        new Department { Name = "DevAV Australia", Marker = Color.FromArgb(0x8F, 0xC9, 0x3A)},
    };
    // The name of the data member storing objects that should be equal to a series data member's values from the main data source.
    SeriesKeyMember = "Name",
    // The name of the data member that contains colors.
    SeriesColorMember = "Marker"
};
See Also