Skip to content

Instantly share code, notes, and snippets.

@evilnapsis
Last active June 22, 2017 08:54
Show Gist options
  • Save evilnapsis/fcb9208a2ac486bac187240bf5d33279 to your computer and use it in GitHub Desktop.
Save evilnapsis/fcb9208a2ac486bac187240bf5d33279 to your computer and use it in GitHub Desktop.
Grafica de Pie con Chart.js
var ctx = document.getElementById("chart1");
var red = "#f00";
var orange = "#f50";
var yellow = "#ff0";
var green = "#0f0";
var blue = "#00f";
var myPieChart = new Chart(ctx,{
type: 'pie',
data: {
datasets: [{
data: [ 1,2,3,4,5 ],
backgroundColor: [ red, orange, yellow,green, blue],
label: 'Dataset 1'
}],
labels: [ "Red", "Orange", "Yellow", "Green", "Blue" ]
},
options: {
responsive: true
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment