<html>

<head>
    <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
    <title>ESPMeter</title>
</head>

<body>
    Aggregation:
    <select id="aggregation" onchange="drawGraph()">
        <option value="day">Day</option>
        <option value="hour" selected>Hour</option>
        <option value="5min">5min</option>
    </select>

    <div id="plot"></div>
</body>

<script>

    function drawGraph() {

        document.getElementById("plot").innerHTML = "Loading data...";

        aggregatio