React PieChart - Handle Tooltip Events

When a tooltip becomes shown or hidden, the PieChart fires the tooltipShown or tooltipHidden event that you can handle with a function. If the handling function is not going to be changed during the lifetime of the UI component, assign it to the onTooltipShown or onTooltipHidden property respectively, when you configure the UI component.

App.js
  • import React from 'react';
  • import PieChart from 'devextreme-react/pie-chart';
  •  
  • class App extends React.Component {
  • render() {
  • return (
  • <PieChart ...
  • onTooltipShown={onTooltipShown}
  • onTooltipHidden={onTooltipHidden}>
  • </PieChart>
  • );
  • }
  • }
  •  
  • function onTooltipShown(e) {
  • let point = e.target;
  • // Handler of the "tooltipShown" event
  • }
  • function onTooltipHidden(e) {
  • let point = e.target;
  • // Handler of the "tooltipHidden" event
  • }
See Also