]> ToastFreeware Gitweb - chrisu/seepark.git/blobdiff - web/static/seepark_web.js
turn on x grid lines on chrisu's request
[chrisu/seepark.git] / web / static / seepark_web.js
index d02357590a2d39df15c073f9311ce5852fa4876c..40fd919c58fb041eda12571913bd7f9635041474 100644 (file)
@@ -149,6 +149,9 @@ function dayschart(element, title, days, xtickformat) {
                grid: {
                        y: {
                                show: true
+                       },
+                       x: {
+                               show: true
                        }
                },
                regions: [
@@ -162,11 +165,7 @@ function dayschart(element, title, days, xtickformat) {
        // reload data in charts
        setInterval(
                function() {
-                       chart.load({
-                               url: api_base_url_sensors + beginend(days),
-                               mimeType: 'json'
-                       });
-                       chart.flush();
+                       loaddays(chart, element, days);
                },
                refresh_interval
        );
@@ -224,19 +223,19 @@ setInterval(
                        .then((resp) => resp.json())
                        .then(function(data) {
                                airvalue.innerText = data['value'].toFixed(1);
-                               airtime.innerText  = strftime('%Y-%m-%d H:%M', data['timestamp']);
+                               airtime.innerText  = strftime('%Y-%m-%d %H:%M', new Date(data['timestamp']));
                        })
                        .catch(function(error) {
-                               // handle error
+                               console.log(error);
                        });
                fetch(api_url_currentwater)
                        .then((resp) => resp.json())
                        .then(function(data) {
                                watervalue.innerText = data['value'].toFixed(1);
-                               watertime.innerText  = strftime('%Y-%m-%d H:%M', data['timestamp']);
+                               watertime.innerText  = strftime('%Y-%m-%d %H:%M', new Date(data['timestamp']));
                        })
                        .catch(function(error) {
-                               // handle error
+                               console.log(error);
                        });
        },
        refresh_interval