Last active
October 1, 2018 00:37
-
-
Save andregardi/40c3ccb195f61ed9cc6466ba61e18f2e to your computer and use it in GitHub Desktop.
This file contains 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
var labels = [ | |
"Vote for blue", | |
"vote for red", | |
]; | |
var data = [ | |
70, | |
30, | |
]; | |
var pie = document.getElementById("pieChart").getContext('2d'); | |
var myChart = new Chart(pie, { | |
type: 'pie', | |
data: { | |
labels: labels, | |
datasets: [ | |
{ | |
data: data, | |
borderColor: ['rgba(75, 192, 192, 1)', 'rgba(192, 0, 0, 1)'], | |
backgroundColor: ['rgba(75, 192, 192, 0.2)', 'rgba(192, 0, 0, 0.2)'], | |
} | |
] | |
}, | |
options: { | |
title: { | |
display: true, | |
text: "Colors election" | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment