-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconverter.html
More file actions
130 lines (108 loc) · 3.35 KB
/
converter.html
File metadata and controls
130 lines (108 loc) · 3.35 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
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>数据统计 · OpenVPI</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow">
<meta name="googlebot" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style id="compiled-css" type="text/css">
.highcharts-figure,
.highcharts-data-table table {
min-width: 360px;
max-width: 800px;
margin: 1em auto;
}
.highcharts-data-table table {
font-family: Verdana, sans-serif;
border-collapse: collapse;
border: 1px solid #ebebeb;
margin: 10px auto;
text-align: center;
width: 100%;
max-width: 500px;
}
.highcharts-data-table caption {
padding: 1em 0;
font-size: 1.2em;
color: #555;
}
.highcharts-data-table th {
font-weight: 600;
padding: 0.5em;
}
.highcharts-data-table td,
.highcharts-data-table th,
.highcharts-data-table caption {
padding: 0.5em;
}
.highcharts-data-table thead tr,
.highcharts-data-table tr:nth-child(even) {
background: #f8f8f8;
}
.highcharts-data-table tr:hover {
background: #f1f7ff;
}
/* EOS */
</style>
<script id="insert"></script>
</head>
<body>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<figure class="highcharts-figure">
<div id="container"></div>
</figure>
<script type="text/javascript">//<![CDATA[
$.getJSON('./data.json', function (data) {
let chart = {
chart: {
type: 'line'
},
title: {
text: '转换器下载量统计'
},
xAxis: {
categories: []
},
yAxis: {
title: {
text: null
},
min: 0
},
plotOptions: {
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: true
}
},
series: [
{
name: '当日下载量',
color: '#0d47a1',
data: []
}
]
};
let date = new Date(data.date);
for (let i = data.converter.downloads.recent.length - 1; i >= 0; --i) {
date = new Date(date.getTime() - 24 * 60 * 60 * 1000)
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
chart.xAxis.categories.push(month + '-' + day);
chart.series[0].data.push(data.converter.downloads.recent[i]);
}
chart.xAxis.categories.reverse();
chart.series[0].data.reverse();
Highcharts.chart('container', chart);
});
//]]></script>
</body>
</html>