jquery - Morris graphs. Have custom tooltip when hover -


i using morris.js (which has dependency on raphael) creating stacked bar graphs. each stacked bar want show split various levels in bar tooltip. tried using hovercallback: doesn't seem give me control on particular element hovering over. content particular bar.

i have setup jsbin example same here:

when hover on bar shows index of bar @ bottom. want show content tool tip instead.jsbin example

piece of cake. demo , code:

<script type="text/javascript"> morris.bar({     element: 'bar-example',     data: [         {y: '2006',a: 100,b: 90},          {y: '2007',a: 75,b: 65},          {y: '2008',a: 50,b: 40},          {y: '2009',a: 75,b: 65},          {y: '2010',a: 50,b: 40},          {y: '2011',a: 75,b: 65},          {y: '2012',a: 100,b: 90}     ],     hovercallback: function(index, options, content) {         return(content);     },     xkey: 'y',     ykeys: ['a', 'b'],     stacked: true,     labels: ['series a', 'series b'] // rename 'onhover' caption change }); </script> 

upd:

for flying label, need add morris css stylesheet code - demo

important note

flying labels works since version 0.4.3


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -