Skip to content

Instantly share code, notes, and snippets.

@tomwis
Created February 11, 2018 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomwis/7142e4c97a46cf8b5eee485d29a63319 to your computer and use it in GitHub Desktop.
Save tomwis/7142e4c97a46cf8b5eee485d29a63319 to your computer and use it in GitHub Desktop.
<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)'
]
}]
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment