Back to Devexpress

SankeyDiagramControl.CustomizeLinkToolTip Event

windowsforms-devexpress-dot-xtracharts-dot-sankey-dot-sankeydiagramcontrol-9b299dd7.md

latest3.9 KB
Original Source

SankeyDiagramControl.CustomizeLinkToolTip Event

Occurs before a tooltip is displayed for a link 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 CustomizeSankeyLinkToolTipEventHandler CustomizeLinkToolTip
vb
Public Event CustomizeLinkToolTip As CustomizeSankeyLinkToolTipEventHandler

Event Data

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

PropertyDescription
ContentSpecifies the tooltip’s content. Inherited from CustomizeSankeyToolTipEventArgs.
LinkReturns the link whose tooltip is customized.
TitleSpecifies the tooltip’s title. Inherited from CustomizeSankeyToolTipEventArgs.

Remarks

Handle the CustomizeNodeToolTip event to customize tooltips for nodes.

Example

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

csharp
private void Form1_Load(object sender, EventArgs e) {
    sankeyDiagramControl1.ToolTipOptions.LinkToolTipEnabled = DevExpress.Utils.DefaultBoolean.True;
    sankeyDiagramControl1.ToolTipController = new DevExpress.Utils.ToolTipController { 
        ToolTipType = DevExpress.Utils.ToolTipType.Flyout, 
        AllowHtmlText = true 
    };
    sankeyDiagramControl1.CustomizeLinkToolTip += OnCustomizeLinkToolTip;
}

private void OnCustomizeLinkToolTip(object sender, CustomizeSankeyLinkToolTipEventArgs e) {
    e.Title = $"{e.Link.SourceNode.Tag}{e.Link.TargetNode.Tag}";
    e.Content = $"{e.Link.TotalWeight}";
}
vb
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
    sankeyDiagramControl1.ToolTipOptions.LinkToolTipEnabled = DevExpress.Utils.DefaultBoolean.[True]
    sankeyDiagramControl1.ToolTipController = New DevExpress.Utils.ToolTipController With {
        .ToolTipType = DevExpress.Utils.ToolTipType.Flyout,
        .AllowHtmlText = True
    }
    sankeyDiagramControl1.CustomizeLinkToolTip += AddressOf OnCustomizeLinkToolTip
End Sub

Private Sub OnCustomizeLinkToolTip(ByVal sender As Object, ByVal e As CustomizeSankeyLinkToolTipEventArgs)
    e.Title = $"{e.Link.SourceNode.Tag} → {e.Link.TargetNode.Tag}"
    e.Content = $"{e.Link.TotalWeight}"
End Sub

See Also

SankeyDiagramControl Class

SankeyDiagramControl Members

DevExpress.XtraCharts.Sankey Namespace