From: gregor herrmann Date: Mon, 4 Jun 2018 19:46:56 +0000 (+0200) Subject: next attempt with the reload-on-zoom function. not yet working, esp. one doesn't... X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/commitdiff_plain/179bfba13289a427e9e68448f09a247f034a1bcc?hp=-c next attempt with the reload-on-zoom function. not yet working, esp. one doesn't get "out" --- 179bfba13289a427e9e68448f09a247f034a1bcc diff --git a/web/static/seepark_web.js b/web/static/seepark_web.js index 73e9ac2..0bda800 100644 --- a/web/static/seepark_web.js +++ b/web/static/seepark_web.js @@ -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: {