]> ToastFreeware Gitweb - chrisu/seepark.git/blobdiff - web/static/seepark_web.js
loaddays: wrap .flush in a setTimeout
[chrisu/seepark.git] / web / static / seepark_web.js
index e12e464b570a8687f1df3b6484cdfaa320949ab0..7e727a1f0927b31351122c6f2a8c00f9ac289e77 100644 (file)
@@ -67,7 +67,6 @@ function dayschart(element, title, days, xtickformat) {
                        chart.resize({
                                width: getwidth(element)
                        });
-                       // chart.flush();
                },
                transition: {
                        duration: null
@@ -179,14 +178,17 @@ function loaddays(chart, element, days) {
        if (element.substr(0, 7) == 'chart_w') {
                chart.load({
                        url: api_base_url_sensors + beginend(days),
-                       mimeType: 'json'
+                       mimeType: 'json',
+                       unload: true
                });
        } else {
                chart.load({
                        url: api_base_url_weather + beginend(days),
-                       mimeType: 'json'
+                       mimeType: 'json',
+                       unload: true
                });
-       }
+       };
+       setTimeout(function () { chart.flush(); }, 5000);
 }
 
 function beginend(days) {