Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. var especialidade = [];
  2. var totais = [];
  3. function especFn() {
  4.  
  5.  
  6. $.ajax({
  7. url : 'function/especialidade.php',
  8. type : 'post',
  9. dataType : 'json',
  10. data : {
  11. acao : 'Z'
  12. }
  13. ,success : function (data) {
  14. $.each( data, function (i, j) {
  15. //console.log("Espe: "+j.espec);
  16. especialidade.push( j.espec );
  17. totais.push( j.total )
  18.  
  19. } );
  20.  
  21. console.log( especialidade );
  22. console.log( totais );
  23.  
  24. }
  25. });
  26.  
  27. }
  28.  
  29. var barChartData = {
  30.  
  31. //labels : ["January","February","March","April","May","June","July"],
  32. labels : especialidade,
  33. datasets : [
  34.  
  35. {
  36. fillColor : "rgba(48, 164, 255, 0.2)",
  37. strokeColor : "rgba(48, 164, 255, 0.8)",
  38. highlightFill : "rgba(48, 164, 255, 0.75)",
  39. highlightStroke : "rgba(48, 164, 255, 1)",
  40. //data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
  41. data : [1,3]
  42. }
  43. ]
  44.  
  45. }
  46.  
  47. window.onload = function(){
  48.  
  49. especFn();
  50.  
  51.  
  52. var chart2 = document.getElementById("bar-chart").getContext("2d");
  53. window.myBar = new Chart(chart2).Bar(barChartData, {
  54. responsive : true
  55. });
  56.  
  57. };
  58.  
  59. (2) ["ClĂ­nico Geral", "Nutricionista"]
  60. (2) ["1", "3"]
  61.  
  62. var pieData = [
  63. {
  64. value: 300,
  65. color:"#30a5ff",
  66. highlight: "#62b9fb",
  67. label: "Blue"
  68. },
  69. {
  70. value: 50,
  71. color: "#ffb53e",
  72. highlight: "#fac878",
  73. label: "Orange"
  74. },
  75. {
  76. value: 100,
  77. color: "#1ebfae",
  78. highlight: "#3cdfce",
  79. label: "Teal"
  80. },
  81. {
  82. value: 120,
  83. color: "#f9243f",
  84. highlight: "#f6495f",
  85. label: "Red"
  86. }
  87.  
  88. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement