]> ToastFreeware Gitweb - chrisu/seepark.git/blobdiff - web/static/seepark_web.js
add 2 new routes /api/<version>/current{air,water}temperature
[chrisu/seepark.git] / web / static / seepark_web.js
index 721c586c2f9cb8fb2d8387484760c9e32018ce3e..583a14a7d4f619d4ea4742a4d28503c0da220bce 100644 (file)
@@ -155,8 +155,18 @@ function dayschart(element, title, days, xtickformat) {
                        {axis: 'y', start:  100, end: 999, class: 'region-boiling'}
                ]
        });
                        {axis: 'y', start:  100, end: 999, class: 'region-boiling'}
                ]
        });
-       // woraround for unrendered dots
-       setTimeout(function () { chart.flush(); }, 5000);
+
+       // reload data
+       setInterval(
+               function() {
+                       chart.load({
+                               url: api_base_url_sensors + beginend(days),
+                               mimeType: 'json'
+                       });
+                       chart.flush();
+               },
+               5 * 60 * 1000
+       );
 };
 
 function loaddays(chart, element, days) {
 };
 
 function loaddays(chart, element, days) {