Skip to content

Instantly share code, notes, and snippets.

@webloglife
Created November 4, 2016 12:53
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 webloglife/1c24cb9ef50b60c3898638809ed05c45 to your computer and use it in GitHub Desktop.
Save webloglife/1c24cb9ef50b60c3898638809ed05c45 to your computer and use it in GitHub Desktop.
<canvas id="myChart1" width="400" height="250"></canvas>
<script>
var ctx = document.getElementById("myChart1");
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["1月", "2月", "3月", "4月", "5月", "6月"],
datasets: [{
label: 'PV数',
data: [35000, 39500, 103400, 115000, 132851, 183183],
backgroundColor: 'rgba(255, 99, 132, 0.2)',
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