SeriesColorizerBase Class

The base class for all colorizers.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v20.1.dll

Declaration

public abstract class SeriesColorizerBase :
    ChartElement
Public MustInherit Class SeriesColorizerBase
    Inherits ChartElement

Related API Members

The following members accept/return SeriesColorizerBase objects:

Remarks

Refer to the Series Colorizer topic for more information about series colorizers.

Examples

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

class CustomSeriesColorizer : SeriesColorizer {
    List<object> metColors = new List<object>();

    public override Color GetSeriesColor(object seriesKey, Palette palette) {
        int keyIndex;
        if (metColors.Contains(seriesKey)) {
            keyIndex = metColors.IndexOf(seriesKey);
        } else {
            keyIndex = metColors.Count;
            metColors.Add(seriesKey);
        }
        return palette[keyIndex % palette.Count].Color;
    }

    protected override ChartElement CreateObjectForClone() {
        return new CustomSeriesColorizer();
    }
}
See Also