Last active
November 16, 2016 13:37
-
-
Save L-potato/8e598de6a92bf36c6e1ece12950e5932 to your computer and use it in GitHub Desktop.
chart.js-bar
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
<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