Last active
February 6, 2018 02:42
-
-
Save codetricity/cc01db9ab54a7bb13cabe6801d134077 to your computer and use it in GitHub Desktop.
caitlyn Chart.js example lesson #1
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
<head> | |
<script src="Chart.js"></script> | |
<style> | |
canvas { | |
border: 1px; | |
border-color:black; | |
border-style: solid; | |
} | |
</style> | |
</head> | |
<body> | |
<title> Stuffies!</title> | |
<h1> Stuffie February Sales</h1> | |
<canvas id="myChart" width="440" height="440"></canvas> | |
<script> | |
var context = document.getElementById("myChart").getContext('2d'); | |
var myChart = new Chart(context, { | |
type: 'bar', | |
data: { | |
labels: ["Palo Alto", "San Francisco", "Harajuku"], | |
datasets: [{ | |
label: '# of Stuffies', | |
data: [60, 153, 383], | |
backgroundColor: [ | |
'rgba(160, 66, 255, 0.2)', | |
'rgba(255, 66, 232, 0.2)', | |
'rgba(97, 66, 255, 0.2)' | |
] | |
}] | |
}, | |
options: { | |
responsive: false | |
} | |
}) | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment