From: gregor herrmann Date: Mon, 4 Jun 2018 17:45:15 +0000 (+0200) Subject: add prototype for data loading function in zoom change X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/commitdiff_plain/93e38c518b76d229d1dad791c3c73b1de7528464 add prototype for data loading function in zoom change --- diff --git a/web/static/seepark_web.js b/web/static/seepark_web.js index ca30ac1..eedcb44 100644 --- a/web/static/seepark_web.js +++ b/web/static/seepark_web.js @@ -42,7 +42,22 @@ var chart = c3.generate({ } }, zoom: { - enabled: true + enabled: true, + onzoomend: function (domain) { + // UNIX epoch + var start = domain[0].getTime()/1000; + var end = domain[1].getTime()/1000; + 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' + }); + */ + } }, tooltip: { format: {