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
17.2
A newer version of this page is available. Switch to the current version.

DevExtreme jQuery - Show and Hide a Tooltip

Each series point allows you to show or hide its tooltip programmatically by calling 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.

jQuery
JavaScript
$(function() {
    $("#pieChartContainer").dxPieChart({
        // ...
        // 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 the pointer away from the series point
        onPointHoverChanged: function (e) {
            var point = e.target;
            if (!point.isHovered()) {
                point.hideTooltip();
            }
        }
    });
});
Angular
HTML
TypeScript
<dx-pie-chart ...
    (onPointClick)="onPointClick($event)"
    (onPointHoverChanged)="onPointHoverChanged($event)">
</dx-pie-chart>
import { DxPieChartModule } from "devextreme-angular";
// ...
export class AppComponent {
    // Shows the tooltip only when a user clicks a series point
    onPointClick (e) {
        let point = e.target;
        point.showTooltip();
    },
    // Hides the tooltip once the user moves the pointer away from the series point
    onPointHoverChanged (e) {
        let point = e.target;
        if (!point.isHovered()) {
            point.hideTooltip();
        }
    }
}
@NgModule({
    imports: [
        // ...
        DxPieChartModule
    ],
    // ...
})

You can also hide the tooltip regardless of the point to which it belongs by calling the hideTooltip() method of the PieChart instance.

jQuery
JavaScript
$("#pieChartContainer").dxPieChart("hideTooltip");
Angular
TypeScript
import { ..., ViewChild } from "@angular/core";
import { DxPieChartModule, DxPieChartComponent } from "devextreme-angular";
// ...
export class AppComponent {
    @ViewChild(DxPieChartComponent, { static: false }) pieChart: DxPieChartComponent;
    // Prior to Angular 8
    // @ViewChild(DxPieChartComponent) pieChart: DxPieChartComponent;
    hideTooltip () {
        this.pieChart.instance.hideTooltip();
    };
}
@NgModule({
    imports: [
        // ...
        DxPieChartModule
    ],
    // ...
})
See Also