Newer
Older
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Chart</title>
</head>
<body>
<div style="height: 1024px; width: 640px;">
<h1>Runtime Comparison</h1>
<canvas id="barchart" width="1240" height="640"></canvas>
<canvas id="linechart" width="1240" height="640"></canvas>
<canvas id="piechart" width="1240" height="640"></canvas>
</div>
<script src="../js/jquery.min.js"></script>
<script src="../js/Chart.min.js"></script>
<script>
$(function () {
var ctx = document.getElementById("barchart");
var barChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['C++', 'Java 8', 'JavaScript', 'Fortran'],
datasets: [
{
label: "3,636 Forests",
data: [
0.01, 0.24, 0.04, 0.01
],
backgroundColor: "steelblue"
},
{
label: "517,236 Forests",
data: [0.05, 0.62, 1.49, 1.95, 0.10,],
backgroundColor: "#91C3DC"
},
{
label: "2,600,836 Forests",
data: [0.35, 1.46, 8.70, 10.54, 0.96,],
backgroundColor: "#87907D"
}, {
label: "7,254,436 Forests",
data: [1.20, 3.58, 25.59, 29.94, 4.58,],
backgroundColor: "#AAB6A2"
}
]
}
});
ctx = document.getElementById("linechart");
var lineChart = new Chart(ctx, {
type: 'line',
data: {
labels: ['C++', 'Java 8', 'JavaScript', 'Fortran'],
datasets: [
{
label: "3,636 Forests",
data: [
0.01, 0.24, 0.04, 0.01
],
backgroundColor: "steelblue"
},
{
label: "517,236 Forests",
data: [0.05, 0.62, 1.49, 1.95, 0.10,],
backgroundColor: "#91C3DC"
},
{
label: "2,600,836 Forests",
data: [0.35, 1.46, 8.70, 10.54, 0.96,],
backgroundColor: "#87907D"
}, {
label: "7,254,436 Forests",
data: [1.20, 3.58, 25.59, 29.94, 4.58,],
backgroundColor: "#AAB6A2"
}
]
}
});
ctx = document.getElementById("piechart");
var pieChart = new Chart(ctx, {
type: 'pie',
data: {
labels: ['C++', 'Java 8', 'JavaScript', 'Fortran'],
datasets: [
{
data: [1.20, 3.58, 25.59, 29.94, 4.58,],
backgroundColor: [
"steelblue",
"#91C3DC",
"#87907D",
"#AAB6A2"
]
}
]
}
});
});
</script>
</body>
</html>