Skip to main content
All docs
V21.2

SankeyDiagramControl.NodeComparer Property

Gets or sets an algorithm that sorts nodes.

Namespace: DevExpress.Xpf.Charts.Sankey

Assembly: DevExpress.Xpf.Charts.v21.2.dll

Declaration

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

Property Value

Type Description
IComparer<SankeyNode>

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

Remarks

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

<dxsa:SankeyDiagramControl>
    <!--...-->
    <dxsa:SankeyDiagramControl.NodeComparer>
        <local:MyNodeComparer/>
    </dxsa:SankeyDiagramControl.NodeComparer>
    <!--...-->
</dxsa:SankeyDiagramControl>
using DevExpress.Xpf.Charts.Sankey;
//...
public class MyNodeComparer : IComparer<SankeyNode> {
    public int Compare(SankeyNode x, SankeyNode y) {
        return y.TotalWeight.CompareTo(x.TotalWeight);
    }
}
See Also