Remove tooltip from the document manually

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by jeremy on 16th October 2012
Tooltips work fine but is it possible to change the behavior of when they are hidden? Currently, for the onmousemove event, when you move mouse off the canvas, the tooltip continues to display until you click elsewhere. Moving from one object to another within the canvas works fine and as expected. However, the tooltip continues to be displayed after the mouse has moved off the object and off the canvas. I've seen this behavior on all your examples with the tooltips being displayed with onmousemove.
Posted by RGraph support on 17th October 2012
Hi,

Because RGraph doesn't use the onmouseout event you can make use of it for your own purposes - which in this case would be to use the RGraph API to hide the tooltip like this:

myChart.canvas.onmouseout = function (e)
{
     RGraph.HideTooltip();
     RGraph.Redraw();
}

There's an example of this here using the funnel chart:

dev.rgraph.net/tests/funnel/onmouseout.html
Posted by jeremy on 28th February 2013
Thank you (months later) for your quick response (a day)! I ended up using a combination of your examples to solve my problem. Specifically, the bubble scatter and funnel you linked:

pie.Set('chart.tooltips': onmousemove);

pie.canvas.onmousemout = function (e)
{
     var obj = e.target.__object__;
     var shape = obj.getShape(e);
     if (!shape) {
         RGraph.HideTooltip();
         RGraph.Redraw();
     }
}

dev.rgraph.net/demos/scatter02.html

Works good! Thanks again!

Add a reply




« Back to message list