score:1

    let tooltipel = document.getelementbyid('chartjs-tooltip');

    if (!tooltipel) {
      tooltipel = document.createelement('div');
      tooltipel.id = 'chartjs-tooltip';
      tooltipel.innerhtml = `<table></table>`;
      document.body.appendchild(tooltipel);

      tooltipel.addeventlistener('mouseleave', () => {
        tooltipel.style.opacity = 0;
      });
      tooltipel.addeventlistener('mouseenter', () => {
        tooltipel.style.opacity = 1;
      });

you can also control tooltip visibility in afterevent hook.

    plugins: [
      {
        id: 'turnofftooltipplugin',
        afterevent(chart, args, pluginoptions) {
          const { event } = args;

          if (event.native.type === 'mouseout') {
            let tooltipel = document.getelementbyid('chartjs-tooltip');

           if (tooltipel) {
             tooltipel.style.opacity = 0;
           }
        }
      }
     ]

Related Query

More Query from same tag