Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SankeyDiagramControl.NodeComparer Property

Gets or sets an algorithm that sorts nodes.

Namespace: DevExpress.XtraCharts.Sankey

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

NuGet Package: DevExpress.Win.Charts

#Declaration

[Browsable(false)]
public IComparer<SankeyNode> NodeComparer { get; set; }

#Property Value

Type Description
IComparer<SankeyNode>

An object of a class that implements IComparer<SankeyNode>.

#Remarks

The following code arranges nodes in descending order based on their TotalWeight values:

private void Form1_Load(object sender, EventArgs e) {
    sankeyDiagramControl1.NodeComparer = new MyNodeComparer();
}

public class MyNodeComparer : IComparer<SankeyNode> {
    public int Compare(SankeyNode x, SankeyNode y) {
        return y.TotalWeight.CompareTo(x.TotalWeight);
    }
}
See Also