jquery - Multiple Morris graphics not working -
i'm using morris.js plugin use graphics. need page various donuts graphics, when put more one, last 1 doesn't work.
the morris call is:
<div id="grapht"></div>
and, js is:
<script type="text/javascript"> morris.donut({ element: 'grapht', data: [ {value: 50, label: '05'}, {value: 10, label: '07'}, {value: 40, label: '07'}, ], labelcolor: '#000', colors: [ '#ae1c1c', '#000', '#cc9a00' ], formatter: function (x) { return x + "%"} }).on('click', function(i, row){ console.log(i, row); }); </script>
now whole code:
<div id="grapht"></div> <div id="td"></div> <script type="text/javascript"> morris.donut({ element: 'grapht', data: [ {value: 50, label: '05'}, {value: 10, label: '07'}, {value: 40, label: '07'}, ], labelcolor: '#000', colors: [ '#ae1c1c', '#000', '#cc9a00' ], formatter: function (x) { return x + "%"} }).on('click', function(i, row){ console.log(i, row); }); </script> <script type="text/javascript"> morris.donut({ element: 'td', data: [ {value: 50, label: '05'}, {value: 10, label: '07'}, {value: 40, label: '07'}, ], labelcolor: '#000', colors: [ '#ae1c1c', '#000', '#cc9a00' ], formatter: function (x) { return x + "%"} }).on('click', function(i, row){ console.log(i, row); }); </script>
anyone have idea what's happening? can't put on jsfille, because needs morris library.
thanks in advance.
did import morris.js' dependencies ? raphael.js
, jquery
.
Comments
Post a Comment