javascript - jQplot tooltip dismiss issue -


i have implemented simple bar chart,

ive added tooltip feature using highlighter facing issue same.

when move mouse down , exit chart canvas tooltip doesnt dismiss

enter image description here

i have tried adding

 $.jqplot.eventlistenerhooks.push(['jqplotmousemove', handlemove]);  $.jqplot.eventlistenerhooks.push(['jqplotmouseleave', handlemove]); 

but doesnt work , error handlemove not defined

here code fiddle same

https://jsfiddle.net/9j2na3l7/

i got working :)

-- problem:

  • mouse cursor escaping fast canvas, prevents event form fireing

-- solution:

first of grab handle of jplot object

var plotbar = $.jqplot('task_brk_bar_chart', [...

so can use manipulate on run-time.

then use jqplotdatahighlight , jqplotdataunhighlight events change graph properties , replot() function apply them on fly.

$('#task_brk_bar_chart').bind('jqplotdatahighlight', function () {     plotbar.showtooltip = true;     plotbar.replot(); }); $('#task_brk_bar_chart').bind('jqplotdataunhighlight', function () {     plotbar.showtooltip = false;     plotbar.repolot(); }); 

working fiddle : https://jsfiddle.net/urahara/9j2na3l7/1/

note: copy old css override setting, testing purposes only.

cheers!


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -