windowsforms-devexpress-dot-xtracharts-dot-sankey-dot-sankeydiagramcontrol-cb18e982.md
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
public event CustomizeSankeyNodeToolTipEventHandler CustomizeNodeToolTip
Public Event CustomizeNodeToolTip As CustomizeSankeyNodeToolTipEventHandler
The CustomizeNodeToolTip event's data class is CustomizeSankeyNodeToolTipEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Content | Specifies the tooltip’s content. Inherited from CustomizeSankeyToolTipEventArgs. |
| Node | Returns the node whose tooltip is customized. |
| NodeColor | Returns the color of a node whose tooltip is customized. |
| Title | Specifies the tooltip’s title. Inherited from CustomizeSankeyToolTipEventArgs. |
Handle the CustomizeLinkToolTip event to customize tooltips for links.
To format tooltip text for nodes, handle the CustomizeNodeToolTip event and specify the CustomizeSankeyToolTipEventArgs.Title and CustomizeSankeyToolTipEventArgs.Content properties.
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}";
}
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