Show and Hide a Tooltip

Each series point allows you to show or hide its tooltip programmatically. For this, call the showTooltip() or hideTooltip() method of the Point object. You can access this object with the API methods or in the handlers of the point events, such as pointClick, pointHoverChanged, etc. The latter is demonstrated in the following code.

JavaScript
$(function() {
    $("#chartContainer").dxChart({
        // ...
        // Shows the tooltip only when a user clicks a series point
        onPointClick: function (e) {
            var point = e.target;
            point.showTooltip();
        },
        // Hides the tooltip once the user moves away from the series point
        onPointHoverChanged: function (e) {
            var point = e.target;
            if (!point.isHovered()) {
                point.hideTooltip();
            }
        }
    });
});

You can also hide the tooltip regardless of the point to which it belongs. To do this, call the hideTooltip() method of the Chart instance.

JavaScript
$("#chartContainer").dxChart("hideTooltip");
See Also