experiment again with re-loading chart data
authorgregor herrmann <gregor@toastfreeware.priv.at>
Fri, 7 Sep 2018 22:20:52 +0000 (00:20 +0200)
committergregor herrmann <gregor@toastfreeware.priv.at>
Fri, 7 Sep 2018 22:20:52 +0000 (00:20 +0200)
add unload:true, and add back .flush() which got lost in the refactoring

web/static/seepark_web.js

index e12e464..5cdeca5 100644 (file)
@@ -179,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) {