Home Forums Chart Support Hiding tooltip when mouse out of the point

Hiding tooltip when mouse out of the point

Viewing 4 posts - 1 through 4 (of 4 total)
  • #37598

    Is it possible to hide the tooltip when we move the mouse away from the bar/point .
    we don’t want to show the tooltip till the mouse is moved outside.

    #37602

    @sparikh,

    You can use the tooltip hide() method within the dataSeries mouseout function to hide the tooltip when the mouse is moved away from the dataPoint. Please find the code snippet for the same below.

    function onMouseout(e){
       e.chart.toolTip.hide();
    }

    Kindly take a look at this JSFiddle for a working example.

    Hide tooltip on mouseout


    Thangaraj Raman
    Team CanvasJS

    #37614

    Thanks for sharing this example. I tried the same with the line graph but it is not working.
    Can you show, how we can do that with line graph

    #37625

    @sparikh,

    You can set the mouseover and mouseout event handlers and create a custom function using the tooltip updated function to achieve the same behavior with a line chart. Please find the code snippet for the same below.

    toolTip: {
      updated: function(e) {
        if(!showToolTip)
          e.chart.toolTip.hide();
      }
    }

    Please check this updated JSFiddle for a working example.

    Hiding tooltip on mouseout


    Thangaraj Raman
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.