All docs
V19.1
24.1
The page you are viewing does not exist in version 24.1.
23.2
The page you are viewing does not exist in version 23.2.
23.1
The page you are viewing does not exist in version 23.1.
22.2
The page you are viewing does not exist in version 22.2.
22.1
The page you are viewing does not exist in version 22.1.
21.2
The page you are viewing does not exist in version 21.2.
21.1
The page you are viewing does not exist in version 21.1.
20.2
The page you are viewing does not exist in version 20.2.
20.1
The page you are viewing does not exist in version 20.1.
19.2
19.1
18.2
18.1
The page you are viewing does not exist in version 18.1.
17.2
The page you are viewing does not exist in version 17.2.
A newer version of this page is available. Switch to the current version.

DevExtreme jQuery - Show and Hide a Tooltip

Tooltips can be invoked programmatically by calling a Node or Link object's showTooltip() method. You can access these objects with API methods or in event handlers, such as onNodeClick and onLinkClick, onNodeHoverChanged and onLinkHoverChanged. The event handlers are demonstrated in the following code. To hide the tooltip, call the widget instance's hideTooltip() method.

jQuery
JavaScript
$(function() {
    $("#sankeyContainer").dxSankey({
        // ...
        tooltip: { enabled: false },
        // Shows the tooltip only when a sankey link is clicked
        onLinkClick: function(e) {
            e.target.showTooltip();
        },
        // Hides the tooltip when the sankey link is no longer hovered over or pressed
        onLinkHoverChanged: function(e) {
            if (!e.target.isHovered()) {
                e.component.hideTooltip();
            }
        }
    });
});
Angular
HTML
TypeScript
<dx-sankey ...
    (onItemClick)="sankey_onLinkClick($event)"
    (onHoverChanged)="sankey_onLinkHoverChanged($event)">
    <dxo-tooltip
        [enabled]="false">
    </dxo-tooltip>
</dx-sankey>
import { DxSankeyModule } from "devextreme-angular";
// ...
export class AppComponent {
    // Shows the tooltip only when a sankey link is clicked
    sankey_onLinkClick (e) {
        e.target.showTooltip();
    },
    // Hides the tooltip when the sankey link is no longer hovered over or pressed
    sankey_onLinkHoverChanged (e) {
        if (!e.target.isHovered()) {
            e.component.hideTooltip();
        }
    }
}
@NgModule({
    imports: [
        // ...
        DxSankeyModule
    ],
    // ...
})