]> ToastFreeware Gitweb - chrisu/seepark.git/blobdiff - web/static/seepark_web.js
experiment again with re-loading chart data
[chrisu/seepark.git] / web / static / seepark_web.js
index 40fd919c58fb041eda12571913bd7f9635041474..5cdeca5b9b65ea1065e8148ccd8e4788cd076187 100644 (file)
@@ -162,6 +162,9 @@ function dayschart(element, title, days, xtickformat) {
                ]
        });
 
+       // workaround for unrendered dots
+       setTimeout(function () { chart.flush(); }, 5000);
+
        // reload data in charts
        setInterval(
                function() {
@@ -176,14 +179,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
                });
-       }
+       };
+       chart.flush();
 }
 
 function beginend(days) {