Created
February 11, 2018 14:56
-
-
Save tomwis/a878cf2003aed7e4cbf6230a620f8982 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment