Back to Devexpress

SeriesDataSourceColorizer.SeriesColorMember Property

corelibraries-devexpress-dot-xtracharts-dot-seriesdatasourcecolorizer-8b0df040.md

latest4.1 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public string SeriesColorMember { get; set; }
vb
Public Property SeriesColorMember As String

Property Value

TypeDescription
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:

PropertyDescription
SeriesDataSourceColorizer.DataSourceGets or sets the data source whose data items the colorizer uses to paint series.
SeriesDataSourceColorizer.SeriesKeyMemberGets or sets the name of data member whose values represent colors in which the colorizer paints series.
SeriesDataSourceColorizer.SeriesColorMemberGets or sets the name of a data member whose values are used as series identifiers.
csharp
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"
};
vb
Class Department 
    Public Property Name As String
    Public Property Marker As Color
End Class
' ...
chartControl.SeriesTemplate.SeriesColorizer = New SeriesDataSourceColorizer With { _
    ' A data source containing series color.
    .DataSource = New List(Of Department ) From { _
        New Department With { .Name = "DevAV North", Marker = Color.FromArgb(0xE1, 0x83, 0x35)}, _
        New Department With { .Name = "DevAV Europe", Marker = Color.FromArgb(0x1E, 0x91, 0xD6)}, _
        New Department With { .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 a color.
    .SeriesColorMember = "Marker" _
}

See Also

SeriesDataSourceColorizer Class

SeriesDataSourceColorizer Members

DevExpress.XtraCharts Namespace