Back to Devexpress

SankeyDiagramControl.CustomizeNodeToolTip Event

windowsforms-devexpress-dot-xtracharts-dot-sankey-dot-sankeydiagramcontrol-cb18e982.md

latest4.0 KB
Original Source

SankeyDiagramControl.CustomizeNodeToolTip Event

Occurs before a tooltip is displayed for a node and allows you to format tooltip content.

Namespace : DevExpress.XtraCharts.Sankey

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

NuGet Package : DevExpress.Win.Charts

Declaration

csharp
public event CustomizeSankeyNodeToolTipEventHandler CustomizeNodeToolTip
vb
Public Event CustomizeNodeToolTip As CustomizeSankeyNodeToolTipEventHandler

Event Data

The CustomizeNodeToolTip event's data class is CustomizeSankeyNodeToolTipEventArgs. The following properties provide information specific to this event:

PropertyDescription
ContentSpecifies the tooltip’s content. Inherited from CustomizeSankeyToolTipEventArgs.
NodeReturns the node whose tooltip is customized.
NodeColorReturns the color of a node whose tooltip is customized.
TitleSpecifies the tooltip’s title. Inherited from CustomizeSankeyToolTipEventArgs.

Remarks

Handle the CustomizeLinkToolTip event to customize tooltips for links.

Example

To format tooltip text for nodes, handle the CustomizeNodeToolTip event and specify the CustomizeSankeyToolTipEventArgs.Title and CustomizeSankeyToolTipEventArgs.Content properties.

csharp
private void Form1_Load(object sender, EventArgs e) {
    sankeyDiagramControl1.ToolTipOptions.NodeToolTipEnabled = DevExpress.Utils.DefaultBoolean.True;
    sankeyDiagramControl1.ToolTipController = new DevExpress.Utils.ToolTipController { 
        ToolTipType = DevExpress.Utils.ToolTipType.Flyout, 
        AllowHtmlText = true 
    };
    sankeyDiagramControl1.CustomizeNodeToolTip += OnCustomizeNodeToolTip;
}
private void OnCustomizeNodeToolTip(object sender, CustomizeSankeyNodeToolTipEventArgs e) {
    e.Title = $"Country: <u>{e.Node.Tag}</u>";
    e.Content = $"{e.Node.TotalWeight:f1}";
}
vb
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
    sankeyDiagramControl1.ToolTipOptions.NodeToolTipEnabled = DevExpress.Utils.DefaultBoolean.[True]
    sankeyDiagramControl1.ToolTipController = New DevExpress.Utils.ToolTipController With {
        .ToolTipType = DevExpress.Utils.ToolTipType.Flyout,
        .AllowHtmlText = True
    }
    AddHandler SankeyDiagramControl1.CustomizeNodeToolTip, AddressOf OnCustomizeNodeToolTip
End Sub

Private Sub OnCustomizeNodeToolTip(ByVal sender As Object, ByVal e As CustomizeSankeyNodeToolTipEventArgs)
    e.Title = $"Country: <u>{e.Node.Tag}</u>"
    e.Content = $"{e.Node.TotalWeight:f1}"
End Sub

See Also

SankeyDiagramControl Class

SankeyDiagramControl Members

DevExpress.XtraCharts.Sankey Namespace