Pregunta

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.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top