Posted By

jazdian on 11/29/18


Tagged

javascript jquery morrisjs


Versions (?)

Graphic Bar morris.js


 / Published in: JavaScript
 

Create a graphic width morris.js type bar

  1. var $arrColors = ['Blue', 'Gray', 'Red'];
  2. var DatsGraphUsuario = jsondat;
  3. new Morris.Bar({
  4. element: 'graph_tipoincidencia_bar',
  5. data: DatsGraphUsuario,
  6. xkey: 'label',
  7. ykeys: ['value'],
  8. labels: ['Value'],
  9. barColors: function (row, series, type) {
  10. return $arrColors[row.x];
  11. },
  12. barOpacity: 0.6
  13. }).on('click', function(i, row){
  14.  
  15. p.nomTipo.innerHTML = row.label;
  16. p.numTipo.innerHTML = row.value;
  17.  
  18. });

Report this snippet  

You need to login to post a comment.