Skip to content

Instantly share code, notes, and snippets.

@marorika
Created March 29, 2018 15:39
Show Gist options
  • Save marorika/9c862f316e23ac4074a924d9219a28e7 to your computer and use it in GitHub Desktop.
Save marorika/9c862f316e23ac4074a924d9219a28e7 to your computer and use it in GitHub Desktop.
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.bundle.min.js"></script>
<canvas id="myRadar" style="width: 100%; height: 300px;"></canvas>
<script>
var myRadarElement = document.getElementById("myRadar");
var myRadar = new Chart(myRadarElement, {
type: 'radar', // チャートのタイプ
data: { // チャートの内容
labels: ["one", "two", "three", "four", "five", "six"],
datasets: [{
label: 'red',
lineTension: 0, // ベジェ曲線を無効化
data: [12, 19, 3, 5, 2, 3],
backgroundColor: 'RGBA(182,39,93, 0.4)',
borderColor: 'RGBA(182,39,93, 1)',
borderWidth: 1,
pointBackgroundColor: 'RGB(46,106,177)'
}, {
label: 'green',
data: [10, 14, 6, 8, 1, 4],
backgroundColor: 'RGBA(77,169,155, 0.4)',
borderColor: 'RGBA(77,169,155, 1)',
borderWidth: 1,
pointBackgroundColor: 'RGB(46,106,177)'
}]
},
options: { // チャートのその他オプション
// 設定なし
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment