Vue Funnel - Show and Hide a Tooltip

Each funnel item allows you to show its tooltip programmatically by calling the showTooltip() method of the Item object. You can access this object with the API methods or in item event handlers, such as onItemClick, onHoverChanged, etc. The latter is demonstrated in the following code. To hide the tooltip, call the hideTooltip() method of the UI component's instance.

App.vue
  • <template>
  • <DxFunnel
  • @item-click="onItemClick"
  • @hover-changed="onHoverChanged"
  • />
  • </template>
  •  
  • <script>
  • import DxFunnel from 'devextreme-vue/funnel';
  •  
  • export default {
  • components: {
  • DxFunnel
  • },
  • methods: {
  • // Shows the tooltip only when a user clicks a funnel item
  • onItemClick (e) {
  • e.item.showTooltip();
  • },
  • // Hides the tooltip once the user moves the pointer away from the funnel item
  • onHoverChanged (e) {
  • if (!e.item.isHovered()) {
  • e.component.hideTooltip();
  • }
  • }
  • }
  • }
  • </script>
See Also