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
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
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
Post a Comment