next attempt with the reload-on-zoom function. not yet working, esp. one doesn't...
authorgregor herrmann <gregor@toastfreeware.priv.at>
Mon, 4 Jun 2018 19:46:56 +0000 (21:46 +0200)
committergregor herrmann <gregor@toastfreeware.priv.at>
Mon, 4 Jun 2018 19:46:56 +0000 (21:46 +0200)
web/static/seepark_web.js

index 73e9ac2f4492bd165f22fd539f929214fdea180f..0bda80064e8391adc56a63a268d61ae0c9e991cb 100644 (file)
@@ -47,16 +47,13 @@ var chart = c3.generate({
                        // UNIX epoch
                        var start = domain[0].getTime()/1000;
                        var end   = domain[1].getTime()/1000;
-                       var duration = end- start;
+                       var duration = end - start;
                        // duration is now the diff of the "viewport in seconds"
-                       // and now we could try and load more/less data
-                       // this works but doesn't make sense :)
-                       /*
-                       chart.load({
-                               url: '/data/7',
-                               mimeType: 'json'
-                       });
-                       */
+                       // FIXME
+                       var days = Math.round(duration / 86400 / 2);
+                       if (days > 0) {
+                               loaddays(days);
+                       }
                }
        },
        tooltip: {