Back to Devexpress

SankeyPaletteColorizer Class

corelibraries-devexpress-dot-xtracharts-dot-sankey-d7ad0b32.md

latest3.2 KB
Original Source

SankeyPaletteColorizer Class

A colorizer that allows you to specify a palette for a Sankey diagram.

Namespace : DevExpress.XtraCharts.Sankey

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public class SankeyPaletteColorizer :
    SankeyColorizerBase,
    IPaletteProvider,
    ISankeyPaletteRepositoryProvider
vb
Public Class SankeyPaletteColorizer
    Inherits SankeyColorizerBase
    Implements IPaletteProvider,
               ISankeyPaletteRepositoryProvider

Remarks

The Sankey diagram control uses the SankeyPaletteColorizer to color nodes. A new color from the palette is applied to each node with a unique label. Colors repeat if the number of unique labels exceeds the number of palette colors. To apply a gradient fill to links, the control utilizes the source and target node colors.

Specify the Palette property to change colors that are used to paint a Sankey diagram. You can select one of the predefined palettes.

To paint links with the same color, use the LinkColor property.

The code below specifies a diagram’s palette and link color:

csharp
sankeyDiagramControl1.Colorizer = new SankeyPaletteColorizer {
    Palette = Palettes.NorthernLights,
    LinkColor = Color.Gray
};
vb
sankeyDiagramControl1.Colorizer = New SankeyPaletteColorizer With {
            .Palette = Palettes.NorthernLights,
            .LinkColor = Color.Gray
        }

You can also create a new palette as follows:

csharp
using System.Drawing;
//...
    Palette palette = new Palette("Custom") {
        Color.Red,
        Color.Green,
        Color.Blue
    };
    sankeyDiagramControl1.Colorizer = new SankeyPaletteColorizer { Palette = palette };
vb
Imports System.Drawing
'...
    Dim palette As Palette = New Palette("Custom") From {
        Color.Red,
        Color.Green,
        Color.Blue
    }
    sankeyDiagramControl1.Colorizer = New SankeyPaletteColorizer With {
        palette
    }

Implements

ISankeyColorizer

Inheritance

Object SankeyColorizerBase SankeyPaletteColorizer

See Also

SankeyPaletteColorizer Members

DevExpress.XtraCharts.Sankey Namespace