Guest User

Untitled

a guest
Feb 23rd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <canvas id="myChart" width="200" height="200"></canvas>
  2. <script>
  3. var ctx = document.getElementById("myChart").getContext('2d');
  4. var myChart = new Chart(ctx, {
  5. type: 'bar',
  6. data: {
  7. labels: ["Red", "Blue"],
  8. datasets: [{
  9. label: 'Which color do you like?',
  10. data: [12, 19],
  11. backgroundColor: [
  12. 'rgba(255, 99, 132, 0.2)',
  13. 'rgba(54, 162, 235, 0.2)'
  14. ],
  15. borderColor: [
  16. 'rgba(255,99,132,1)',
  17. 'rgba(54, 162, 235, 1)'
  18. ],
  19. borderWidth: 1
  20. }]
  21. },
  22. options: {
  23. scales: {
  24. yAxes: [{
  25. ticks: {
  26. beginAtZero: true
  27. }
  28. }]
  29. }
  30. }
  31. });
  32. </script>
Add Comment
Please, Sign In to add comment