Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. var doughnutData = {
  2. labels: [
  3. "DM orange",
  4. "DM rosa",
  5. "DM lilla",
  6. "DM gron",
  7. "DM turkis"
  8. ],
  9. datasets: [
  10. {
  11. data: [43667, 453, 80924, 896, 88],
  12. backgroundColor: [
  13. "#ec8316",
  14. "#AF23A5",
  15. "#66008C",
  16. "#568E14",
  17. "#00829B"
  18. ],
  19. hoverBackgroundColor: [
  20. "#ff8300",
  21. "#9d3292",
  22. "#522e91",
  23. "#5d9632",
  24. "#0083a8"
  25. ]
  26. }]
  27. };
  28.  
  29. jQuery(document).ready(function() {
  30. var ctx = document.getElementById("chart-area").getContext("2d");
  31.  
  32. window.myDoughnutChart = new Chart(ctx, {
  33. type: 'doughnut',
  34. data: doughnutData,
  35. options: {
  36. responsive: true,
  37. elements: {
  38. arc: {
  39. borderColor: "#000000"
  40. }
  41. },
  42. cutoutPercentage: 50
  43. },
  44. animation:{
  45. animateScale: true
  46. }
  47. });
  48. });
  49. var doughnutData1 = {
  50. labels: [
  51. "orange",
  52. "rosa",
  53. "lilla",
  54. "gron",
  55. "turkis"
  56. ],
  57. datasets: [
  58. {
  59. data: [10913, 2693, 4104, 26832, 21443],
  60. backgroundColor: [
  61. "#ec8316",
  62. "#AF23A5",
  63. "#66008C",
  64. "#568E14",
  65. "#00829B"
  66. ],
  67. hoverBackgroundColor: [
  68. "#ff8300",
  69. "#9d3292",
  70. "#522e91",
  71. "#5d9632",
  72. "#0083a8"
  73. ]
  74. }]
  75. };
  76. // <!-- teste 2 usando Chart.js / Gráficos enfileirados -->
  77.  
  78. jQuery(document).ready(function() {
  79. var ctx1 = document.getElementById("chart-area2").getContext("2d");
  80.  
  81. window.myDoughnutChart2 = new Chart(ctx1, {
  82. type: 'doughnut',
  83. data: doughnutData1,
  84. options: {
  85. responsive: true,
  86. elements: {
  87. arc: {
  88. borderColor: "#333"
  89. }
  90. },
  91. cutoutPercentage: 50
  92. },
  93. animation:{
  94. animateScale: true
  95. }
  96. });
  97. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement