i am working on d3. and the problem which i am facing is that whenever i take the mouse pointer inside the graph it immediately shows the hover details. but the thing is that i am in need of showing the hover details only if the mouse pointer is exactly over the datapoint or a graph point. the graph which i am working is http://code.shutterstock.com/rickshaw/examples/lines.html. any help would be appreciated to reduce the size of the mouse hover area.
Asked
Active
Viewed 197 times
1 Answers
0
Stop event from bubbling up by using stopPropagation
method on the JavaScript/jQuery event object.
If you're using jQuery, this can be done like:
jQuery('#element').on('click', function(e) {
e.stopPropagation();
// do something here
});
For JavaScript, you can see an example here.

designcise
- 4,204
- 1
- 17
- 13
-
Thank you Designcise. can you please explain with the scenario from the above code. – Hk M Jun 11 '13 at 10:51
-
There's an example here: https://developer.mozilla.org/en-US/docs/DOM/DOM_Reference/Examples?redirectlocale=en-US&redirectslug=Gecko_DOM_Reference%2FExamples#Example_5.3A_Event_Propagation – designcise Jun 11 '13 at 10:53