Back to Devexpress

SankeyDiagramControl.Colorizer Property

windowsforms-devexpress-dot-xtracharts-dot-sankey-dot-sankeydiagramcontrol-7f7697e3.md

latest4.0 KB
Original Source

SankeyDiagramControl.Colorizer Property

Gets or sets the colorizer that paints nodes and links.

Namespace : DevExpress.XtraCharts.Sankey

Assembly : DevExpress.XtraCharts.v25.2.UI.dll

NuGet Package : DevExpress.Win.Charts

Declaration

csharp
public ISankeyColorizer Colorizer { get; set; }
vb
Public Property Colorizer As ISankeyColorizer

Property Value

TypeDescription
ISankeyColorizer

An object of a class that implements the ISankeyColorizer interface.

|

Remarks

You can initialize the Colorizer property with a SankeyPaletteColorizer object or a descendant of the ISankeyColorizer interface.

The following code applies a custom palette to a sankey diagram:

csharp
using System.Drawing;
//...
private void Form1_Load(object sender, EventArgs e) {
    Palette palette = new Palette("Custom");
    palette.Add(Color.Red);
    palette.Add(Color.Green);
    palette.Add(Color.Blue);
    sankeyDiagramControl1.Colorizer = new SankeyPaletteColorizer { Palette = palette };
}
vb
Imports System.Drawing
'...
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
    Dim palette As Palette = New Palette("Custom")
    palette.Add(Color.Red)
    palette.Add(Color.Green)
    palette.Add(Color.Blue)
    sankeyDiagramControl1.Colorizer = New SankeyPaletteColorizer With {
        palette
    }
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Colorizer property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-dashboard-custom-items-extension/CS/CustomItemExtension/CustomItems/SankeyChart/SankeyItemControlProvider.cs#L100

csharp
void SetDataBindings(DashboardFlatDataSource flatData) {
    sankey.Colorizer = new SankeyItemColorizer(flatData);
    sankey.SourceDataMember = flatData.GetDisplayTextColumn(dashboardItem.Metadata.Source.UniqueId).Name;

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/SankeyChart/SankeyItemControlProvider.vb#L112

vb
Private Sub SetDataBindings(ByVal flatData As DashboardFlatDataSource)
    sankey.Colorizer = New SankeyItemColorizer(flatData)
    sankey.SourceDataMember = flatData.GetDisplayTextColumn(dashboardItem.Metadata.Source.UniqueId).Name

See Also

SankeyDiagramControl Class

SankeyDiagramControl Members

DevExpress.XtraCharts.Sankey Namespace