Search code examples
javascriptd3.jsonclicklistenerdimple.js

How to hide the tooltip in dimplejs?


I used dimple._showPointTooltip to show my tooltip. In mouseout or mouseleave I want hidden it. Which command do I use to do this?

There are many components in this display.

Command used to display tooltip:

myChart.draw();
mySeries.shapes.on("click", function (e) {
    dimple._showPointTooltip(e, this, myChart, mySeries);
}); 

Solution

  • Since I could not find a more suitable solution, I identified each object and removed them:

            series.shapes.on("mouseleave", function (e) {
                svg.select(".dimple-tooltip").remove();
                svg.select(".dimple-custom-tooltip-box").remove();
                svg.select(".dimple-custom-tooltip-label").remove();
                svg.select(".dimple-line-marker-circle").remove();
                svg.select(".dimple-custom-line-marker-circle").remove();
                svg.select(".dimple-tooltip-dropline").remove();
                svg.select(".dimple-custom-tooltip-dropline").remove();     
            });