Repository navigation
Expand file tree
/
Copy pathdummyChart.html
More file actions
73 lines (65 loc) · 1.65 KB
/
Copy pathdummyChart.html
File metadata and controls
73 lines (65 loc) · 1.65 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<script
src="https://code.jquery.com/jquery-3.2.1.js"
integrity="sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.js">
</script>
<script>
// mysql data comes back as JSON
//
$(document).ready(function(){
var data = [555, 999, 777];
var data2 = [333, 444, 555];
var data3 = [1, 2, 3];
var data4 = [88, 999, 777];
var data5 = [44, 88, 150]
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["2014", "2015", "2016"],
datasets: [{
label: "Touch Downs",
backgroundColor: "blue",
data: data
},
{
label: "Yards Per Game",
backgroundColor: "red",
data: data2
},
{
label: "Receptions",
backgroundColor: "green",
data: data3 },
{
label: "Yards",
backgroundColor: "yellow",
data: data4
},
]
},
options: {
scales: {
xAxes: [{
categorySpacing: 0
}],
yAxes: [{
ticks: {
beginAtZero:true
}
}]
}
}
});
});
</script>
</head>
<body>
<canvas id="myChart" style = "width:400px height:400px">
</canvas>
</body>
</html>