index.ejs
2.78 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
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>Corona Dust</title>
<link rel="icon" href = "dust_icon.jpg">
<link rel="stylesheet" href="css/style.css">
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script language="javascript">
var Feb_Dust_2020 = <%=Feb_Dust_2020%>;
var Mar_Dust_2020 = <%=Mar_Dust_2020%>;
var April_Dust_2020 = <%=April_Dust_2020%>;
var May_Dust_2020 = <%=May_Dust_2020%>;
var June_Dust_2020 = <%=June_Dust_2020%>;
var Feb_Dust_2019 = <%=Feb_Dust_2019%>;
var Mar_Dust_2019 = <%=Mar_Dust_2019%>;
var April_Dust_2019 = <%=April_Dust_2019%>;
var May_Dust_2019 = <%=May_Dust_2019%>;
var June_Dust_2019 = <%=June_Dust_2019%>;
var Feb_Dust_2018 = <%=Feb_Dust_2018%>;
var Mar_Dust_2018 = <%=Mar_Dust_2018%>;
var April_Dust_2018 = <%=April_Dust_2018%>;
var May_Dust_2018 = <%=May_Dust_2018%>;
var June_Dust_2018 = <%=June_Dust_2018%>;
$(document).ready(function() {
var chart = Highcharts.chart('container', {
chart: {
type: 'line'
},
title: {
text: '[2018 - 2020] 2월 ~ 6월 미세먼지 비교'
},
subtitle: {
text: 'Source: <a href="https://data.seoul.go.kr/">서울 열린데이터 광장</a>'
},
xAxis: {
categories: ['2월', '3월', '4월', '5월', '6월'],
title: {
text: null
}
},
yAxis: {
min: 0,
title: {
text: '미세먼지(PM10)',
align: 'high'
},
labels: {
overflow: 'justify'
}
},
tooltip: {
valueSuffix: ' [PM10]'
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -40,
y: 80,
floating: true,
borderWidth: 1,
backgroundColor:
Highcharts.defaultOptions.legend.backgroundColor || '#FFFFFF',
shadow: true
},
credits: {
enabled: false
},
series: [{
name: '2020년',
data: [Feb_Dust_2020,Mar_Dust_2020,April_Dust_2020,May_Dust_2020,June_Dust_2020]
}, {
name: '2019년',
data: [Feb_Dust_2019,Mar_Dust_2019,April_Dust_2019,May_Dust_2019,June_Dust_2019]
}, {
name: '2018년',
data: [Feb_Dust_2018,Mar_Dust_2018,April_Dust_2018,May_Dust_2018,June_Dust_2018]
}]
});
});
</script>
</head>
<body>
<font size=10em>
<strong>
<%= City + "\n"%>
</strong>
</font>
<div class="wrap">
<img src= "dust_icon.jpg" width = 300, height = 300/>
</div>
<div id="container" ></div>
</body>*
</html>