From 179bfba13289a427e9e68448f09a247f034a1bcc Mon Sep 17 00:00:00 2001 From: gregor herrmann Date: Mon, 4 Jun 2018 21:46:56 +0200 Subject: [PATCH] next attempt with the reload-on-zoom function. not yet working, esp. one doesn't get "out" --- web/static/seepark_web.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) 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: { -- 2.47.3