Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <canvas id="myChart" width="200" height="200"></canvas>
- <script>
- var ctx = document.getElementById("myChart").getContext('2d');
- var myChart = new Chart(ctx, {
- type: 'bar',
- data: {
- labels: ["Red", "Blue"],
- datasets: [{
- label: 'Which color do you like?',
- data: [12, 19],
- backgroundColor: [
- 'rgba(255, 99, 132, 0.2)',
- 'rgba(54, 162, 235, 0.2)'
- ],
- borderColor: [
- 'rgba(255,99,132,1)',
- 'rgba(54, 162, 235, 1)'
- ],
- borderWidth: 1
- }]
- },
- options: {
- scales: {
- yAxes: [{
- ticks: {
- beginAtZero: true
- }
- }]
- }
- }
- });
- </script>
Add Comment
Please, Sign In to add comment