charts.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. "use strict";
  2. /* eslint-disable object-curly-newline */
  3. /* global Chart */
  4. /**
  5. * --------------------------------------------------------------------------
  6. * CoreUI Free Boostrap Admin Template (v2.1.15): main.js
  7. * Licensed under MIT (https://coreui.io/license)
  8. * --------------------------------------------------------------------------
  9. */
  10. /* eslint-disable no-magic-numbers */
  11. // random Numbers
  12. var random = function random() {
  13. return Math.round(Math.random() * 100);
  14. }; // eslint-disable-next-line no-unused-vars
  15. var lineChart = new Chart($('#canvas-1'), {
  16. type: 'line',
  17. data: {
  18. labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
  19. datasets: [{
  20. label: 'My First dataset',
  21. backgroundColor: 'rgba(220, 220, 220, 0.2)',
  22. borderColor: 'rgba(220, 220, 220, 1)',
  23. pointBackgroundColor: 'rgba(220, 220, 220, 1)',
  24. pointBorderColor: '#fff',
  25. data: [random(), random(), random(), random(), random(), random(), random()]
  26. }, {
  27. label: 'My Second dataset',
  28. backgroundColor: 'rgba(151, 187, 205, 0.2)',
  29. borderColor: 'rgba(151, 187, 205, 1)',
  30. pointBackgroundColor: 'rgba(151, 187, 205, 1)',
  31. pointBorderColor: '#fff',
  32. data: [random(), random(), random(), random(), random(), random(), random()]
  33. }]
  34. },
  35. options: {
  36. responsive: true
  37. }
  38. }); // eslint-disable-next-line no-unused-vars
  39. var barChart = new Chart($('#canvas-2'), {
  40. type: 'bar',
  41. data: {
  42. labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
  43. datasets: [{
  44. backgroundColor: 'rgba(220, 220, 220, 0.5)',
  45. borderColor: 'rgba(220, 220, 220, 0.8)',
  46. highlightFill: 'rgba(220, 220, 220, 0.75)',
  47. highlightStroke: 'rgba(220, 220, 220, 1)',
  48. data: [random(), random(), random(), random(), random(), random(), random()]
  49. }, {
  50. backgroundColor: 'rgba(151, 187, 205, 0.5)',
  51. borderColor: 'rgba(151, 187, 205, 0.8)',
  52. highlightFill: 'rgba(151, 187, 205, 0.75)',
  53. highlightStroke: 'rgba(151, 187, 205, 1)',
  54. data: [random(), random(), random(), random(), random(), random(), random()]
  55. }]
  56. },
  57. options: {
  58. responsive: true
  59. }
  60. }); // eslint-disable-next-line no-unused-vars
  61. var doughnutChart = new Chart($('#canvas-3'), {
  62. type: 'doughnut',
  63. data: {
  64. labels: ['Red', 'Green', 'Yellow'],
  65. datasets: [{
  66. data: [300, 50, 100],
  67. backgroundColor: ['#FF6384', '#36A2EB', '#FFCE56'],
  68. hoverBackgroundColor: ['#FF6384', '#36A2EB', '#FFCE56']
  69. }]
  70. },
  71. options: {
  72. responsive: true
  73. }
  74. }); // eslint-disable-next-line no-unused-vars
  75. var radarChart = new Chart($('#canvas-4'), {
  76. type: 'radar',
  77. data: {
  78. labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'],
  79. datasets: [{
  80. label: 'My First dataset',
  81. backgroundColor: 'rgba(220, 220, 220, 0.2)',
  82. borderColor: 'rgba(220, 220, 220, 1)',
  83. pointBackgroundColor: 'rgba(220, 220, 220, 1)',
  84. pointBorderColor: '#fff',
  85. pointHighlightFill: '#fff',
  86. pointHighlightStroke: 'rgba(220, 220, 220, 1)',
  87. data: [65, 59, 90, 81, 56, 55, 40]
  88. }, {
  89. label: 'My Second dataset',
  90. backgroundColor: 'rgba(151, 187, 205, 0.2)',
  91. borderColor: 'rgba(151, 187, 205, 1)',
  92. pointBackgroundColor: 'rgba(151, 187, 205, 1)',
  93. pointBorderColor: '#fff',
  94. pointHighlightFill: '#fff',
  95. pointHighlightStroke: 'rgba(151, 187, 205, 1)',
  96. data: [28, 48, 40, 19, 96, 27, 100]
  97. }]
  98. },
  99. options: {
  100. responsive: true
  101. }
  102. }); // eslint-disable-next-line no-unused-vars
  103. var pieChart = new Chart($('#canvas-5'), {
  104. type: 'pie',
  105. data: {
  106. labels: ['Red', 'Green', 'Yellow'],
  107. datasets: [{
  108. data: [300, 50, 100],
  109. backgroundColor: ['#FF6384', '#36A2EB', '#FFCE56'],
  110. hoverBackgroundColor: ['#FF6384', '#36A2EB', '#FFCE56']
  111. }]
  112. },
  113. options: {
  114. responsive: true
  115. }
  116. }); // eslint-disable-next-line no-unused-vars
  117. var polarAreaChart = new Chart($('#canvas-6'), {
  118. type: 'polarArea',
  119. data: {
  120. labels: ['Red', 'Green', 'Yellow', 'Grey', 'Blue'],
  121. datasets: [{
  122. data: [11, 16, 7, 3, 14],
  123. backgroundColor: ['#FF6384', '#4BC0C0', '#FFCE56', '#E7E9ED', '#36A2EB']
  124. }]
  125. },
  126. options: {
  127. responsive: true
  128. }
  129. });
  130. //# sourceMappingURL=charts.js.map