Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. <script>
  2.  
  3. // console.log(registres);
  4.  
  5. var registres_index = [];
  6. var bg = [];
  7. var bg = [ 'rgba(255, 99, 132,0.2)', 'rgba(179, 181, 198,0.2)', 'rgba(255, 221, 50,0.2)' ];
  8.  
  9. var bg1 = 'rgba(255, 99, 132,0.2)';
  10. var bg2 = 'rgba(179, 181, 198,0.2)';
  11. var bg3 = 'rgba(255, 221, 50,0.2)';
  12.  
  13.  
  14. //var chartCfg = [];
  15. $.each(registres, function(index, value) {
  16. //registres_index.push(value);
  17. //chartCfg.push(value["fill"]);
  18. /* value["backgroundColor"] = [];
  19. value["backgroundColor"].push(bg);*/
  20. // registres["backgroundColor"].push(bg);
  21. /*value["backgroundColor"] = [bg1, bg2, bg3];*/
  22.  
  23. /*value["backgroundColor"].push(bg);*/
  24. /* console.log('totot', value["backgroundColor"]);*/
  25.  
  26. var _rid = value['registre_id'];
  27. value['label'] = value['registre_description'];
  28. // console.log(index);
  29. //console.log(_rid);
  30. /*console.log(Math.round((value['count_traitements_ok'] * 100) / (value['count_traitements_ok'] + value['count_traitements_nok'])));*/
  31. value['fill'] = true;
  32. /*value['backgroundColor'] = ['rgb(19, 40, 219)', 'rgb(105, 79, 32)', 'rgb(30, 119, 50)'];*/
  33. /* value['fillStyle'] = ['rgb(19, 40, 219)', 'rgb(105, 79, 32)', 'rgb(30, 119, 50)'];*/
  34.  
  35. /*value['fillColor'] = ["rgba(220,220,220,0.5)", "navy", "red", "orange"];*/
  36.  
  37. /*value['borderColor'] = ['rgb(19, 40, 219)', 'rgb(105, 79, 32)', 'rgb(30, 119, 50)'];
  38. value['pointBorderColor'] = ['rgb(19, 40, 219)', 'rgb(105, 79, 32)', 'rgb(30, 119, 50)'];
  39. value['pointBackgroundColor'] = ['rgb(19, 40, 219)', 'rgb(105, 79, 32)', 'rgb(30, 119, 50)'];*/
  40. /*value['backgroundColor'] = [ 'rgba(255, 99, 132,0.2)', 'rgba(179, 181, 198,0.2)', 'rgba(255, 221, 50,0.2)' ];*/
  41. /*value['backgroundColor'] = bg;*/
  42. value["backgroundColor"] = ['rgba(255, 99, 132,0.2)', 'rgba(179, 181, 198,0.2)', 'rgba(255, 221, 50,0.2)'];
  43. value['data'] = [Math.round((value['count_traitements_ok'] * 100) / (value['count_traitements_ok'] + value['count_traitements_nok'])), Math.round((value['count_demandes_ok'] * 100) / (value['count_demandes_ok'] + value['count_demandes_nok'])), Math.round((value['count_taches_ok'] * 100) / (value['count_taches_ok'] + value['count_taches_nok']))];
  44. //value['data'] = [ , "42", "78"];
  45.  
  46. registres_index.push(value);
  47. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement