Skip to main content
A newer version of this page is available. .
All docs
V20.2

SankeyDiagramControl.ToolTipController Property

Specifies the tooltip controller component that specifies the appearance, position, and other tooltip settings.

Namespace: DevExpress.XtraCharts.Sankey

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

NuGet Package: DevExpress.Win.Charts

Declaration

public ToolTipController ToolTipController { get; set; }

Property Value

Type Description
ToolTipController

A tooltip controller.

Remarks

Tooltips are shown when you hover the mouse pointer over a node or link. Use the SankeyToolTipOptions.NodeToolTipEnabled, SankeyToolTipOptions.LinkToolTipEnabled and ToolTipController properties to disable/enable tooltips and customize their appearance.

Example

The following example formats text used in tooltips.

To format tooltip text, handle the CustomizeNodeToolTip and CustomizeLinkToolTip events and specify the CustomizeSankeyToolTipEventArgs.Title and CustomizeSankeyToolTipEventArgs.Content properties in event handlers.

The e.Node.Tag, e.Link.Source.Tag, and e.Link.Target.Tag properties store values that are shown in default tooltip titles. To obtain node and link weights, use the e.Node.TotalWeight and e.Link.TotalWeight properties.

private void Form1_Load(object sender, EventArgs e) {
    sankeyDiagramControl1.ToolTipOptions.LinkToolTipEnabled = DevExpress.Utils.DefaultBoolean.True;
    sankeyDiagramControl1.ToolTipOptions.NodeToolTipEnabled = DevExpress.Utils.DefaultBoolean.True;
    sankeyDiagramControl1.ToolTipController = new DevExpress.Utils.ToolTipController { 
        ToolTipType = DevExpress.Utils.ToolTipType.Flyout, 
        AllowHtmlText = true 
    };
    sankeyDiagramControl1.CustomizeNodeToolTip += OnCustomizeNodeToolTip;
    sankeyDiagramControl1.CustomizeLinkToolTip += OnCustomizeLinkToolTip;
}
private void OnCustomizeNodeToolTip(object sender, CustomizeSankeyNodeToolTipEventArgs e) {
    e.Title = $"Country: <u>{e.Node.Tag}</u>";
    e.Content = $"{e.Node.TotalWeight:f1}";
}

private void OnCustomizeLinkToolTip(object sender, CustomizeSankeyLinkToolTipEventArgs e) {
    e.Title = $"{e.Link.Source.Tag} → {e.Link.Target.Tag}";
    e.Content = $"{e.Link.TotalWeight}";
}
See Also