Skip to content

Instantly share code, notes, and snippets.

@L-potato
Last active November 16, 2016 13:37
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 L-potato/8e598de6a92bf36c6e1ece12950e5932 to your computer and use it in GitHub Desktop.
Save L-potato/8e598de6a92bf36c6e1ece12950e5932 to your computer and use it in GitHub Desktop.
chart.js-bar
<script>
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
//グラフのタイプ指定
type: 'bar',
data: {
labels: ["シーズン1", "シーズン2", "シーズン3", "シーズン4", "シーズン5", "シーズン6"],
datasets: [{
label: '満足度',
data: [90, 95, 80, 92, 100, 28],
backgroundColor: '#f58E7E',
borderWidth: 1
}]
},
options: {
title: {
display: true,
text: '海外ドラマLost(ロスト)の満足度', //グラフの見出し
padding:3
},
scales: {
yAxes: [{
ticks: {
//グラフを0から始める
beginAtZero:true
}
}]
}
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment