Guest User

JS

a guest
May 22nd, 2019
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.     var ctx = document.getElementById('month_insight').getContext('2d');
  3.     var myChart = new Chart(ctx, {
  4.         type: 'bar',
  5.         data: {
  6.             // labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
  7.             labels: [@foreach ($months as $num => $name) '{{ $name }}', @endforeach],
  8.             datasets: [{
  9.                 label: '# transaski',
  10.                 data: [10, 12, 8, 11, 9, 13],
  11.                
  12.                 backgroundColor: [
  13.                     'rgba(255, 99, 132, 0.2)',
  14.                     'rgba(54, 162, 235, 0.2)',
  15.                     'rgba(255, 206, 86, 0.2)',
  16.                     'rgba(75, 192, 192, 0.2)',
  17.                     'rgba(153, 102, 255, 0.2)',
  18.                     'rgba(255, 159, 64, 0.2)'
  19.                 ],
  20.                 borderColor: [
  21.                     'rgba(255, 99, 132, 1)',
  22.                     'rgba(54, 162, 235, 1)',
  23.                     'rgba(255, 206, 86, 1)',
  24.                     'rgba(75, 192, 192, 1)',
  25.                     'rgba(153, 102, 255, 1)',
  26.                     'rgba(255, 159, 64, 1)'
  27.                 ],
  28.                 borderWidth: 1
  29.             }]
  30.         },
  31.         options: {
  32.             scales: {
  33.                 yAxes: [{
  34.                     ticks: {
  35.                         beginAtZero: true
  36.                     }
  37.                 }]
  38.             }
  39.         }
  40.     });
  41.     </script>
Add Comment
Please, Sign In to add comment