index.ejs 2.78 KB
<!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>