✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

How to clear plotly tooltip programmatically?

When viewing plotly graphs on mobile devices, it appears that the tooltip behavior is as such:

  • show the hover tooltip(s) when you tap on the graph traces and the tooltip persists
  • if you tap on the graph, on a place where there is not data, then the tooltip disappears.

However, in some graphs where the entire graph has data on it (i.e. normalized stacked bar graphs or area graphs) there is no easy way to click off the data to get the tooltip to disappear.

So I’m looking for a functional javascript way to clear tooltips that I could bind to a button or maybe set a time interval to display the tooltip so that I can get them to disappear and not continue to clutter the graph.