remove flush after creation, add flush after reload
authorgregor herrmann <gregor@toastfreeware.priv.at>
Wed, 5 Sep 2018 21:24:42 +0000 (23:24 +0200)
committergregor herrmann <gregor@toastfreeware.priv.at>
Wed, 5 Sep 2018 21:24:42 +0000 (23:24 +0200)
web/static/seepark_web.js

index 6d8e1f1..583a14a 100644 (file)
@@ -156,16 +156,14 @@ function dayschart(element, title, days, xtickformat) {
                ]
        });
 
-       // workaround 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
        );