Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: jazdian
Added: Nov 28, 2018 6:59 PM
Modified: Nov 28, 2018 7:03 PM
Views: 7
Create a graphic with morris.js
  1.     var $arrColors = ['Blue', 'Gray',  'Red'];
  2.  
  3.      new Morris.Bar({
  4.           element: 'graph_tipoincidencia_bar',
  5.           data: [{"label":"Arquitectura","value":"4"},{"label":"Desarrollo","value":"2"},{"label":"Soporte Operativo","value":"1"}],
  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. });