/
chart.html
30 lines (30 loc) · 970 Bytes
/
chart.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js"></script>
</head>
<body>
<div style="width: 1000px; height: 800px">
<canvas id="myChart"></canvas>
</div>
<script>
var ctx = document.getElementById("myChart").getContext('2d');
var myChart = new Chart(ctx, {
type: 'line',
data: {
// LabelsStart
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
// LabelsEnd
datasets: [{
label: '//label//',
// DataStart
data: [12, 19, 3, 5, 2, 3],
// DataEnd
backgroundColor: 'rgba(20, 135, 0, 0.5)',
borderColor: 'darkGreen',
borderWidth: 1
}]
}
});
</script>
</body>
</html>