-
Notifications
You must be signed in to change notification settings - Fork 3
/
stats.html.skel
151 lines (137 loc) · 3.88 KB
/
stats.html.skel
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<html>
<head>
<title>Chromium download statistics</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
#versions_chart_view {
overflow-x: scroll;
width: 100%;
}
#versions_chart_container {
width: calc( %(VERSIONS_COUNT) * 1em + 1em + 2em );
height: 20em;
margin-bottom: 2em;
}
#daily_chart_view {
overflow-x: scroll;
width: 100%;
}
#daily_chart_container {
width: calc( 1em + %(DAYS_COUNT) * 1.5em + 1em + 2em );
height: 20em;
margin-bottom: 2em;
}
</style>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.bundle.min.js"></script>
<script>
Chart.defaults.font.size = 11;
Chart.overrides.line.spanGaps = 1*24*60*60*1000;
</script>
<div id="versions_chart_view">
<div id="versions_chart_container">
<canvas id="versions_chart"></canvas>
</div>
</div>
<div id="daily_chart_view">
<div id="daily_chart_container">
<canvas id="daily_chart"></canvas>
</div>
</div>
<script>
const versions_chart = document.getElementById('versions_chart');
new Chart(
versions_chart,
{
type: 'bar',
data: {
datasets: [
{
borderWidth: 1,
%(VERSIONS_DATASET)
}
]
},
options: {
maintainAspectRatio: false,
scales: {
x: {
ticks: {
maxRotation: 90,
minRotation: 90,
autoSkip: false
}
},
y: {
beginAtZero: true,
position: 'right'
}
},
plugins: {
legend: {
display: false
}
},
animation: {
duration: 0
}
}
}
);
var versions_chart_container = document.getElementById('versions_chart_view');
versions_chart_container.scrollLeft = versions_chart_container.scrollWidth;
</script>
<script>
const daily_chart = document.getElementById('daily_chart');
new Chart(
daily_chart,
{
type: 'line',
data: {
datasets: [
%(DAILY_DATASETS)
]
},
options: {
maintainAspectRatio: false,
scales: {
x: {
type: 'time',
time: {
unit: 'day',
displayFormats: {
day: 'yyyy-MM-dd'
}
},
min: '%(DATE_MIN)',
max: '%(TODAY)',
ticks: {
maxRotation: 90,
minRotation: 90,
autoSkip: false
},
offset: true
},
y: {
beginAtZero: true,
position: 'right'
}
},
plugins: {
legend: {
display: false
}
},
animation: {
duration: 0
}
}
}
);
var daily_chart_container = document.getElementById('daily_chart_view');
daily_chart_container.scrollLeft = daily_chart_container.scrollWidth;
</script>
</body>
</html>