X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/blobdiff_plain/105e2625c0cacd63414fa47979f882672f633e35..68f929e4730c288a903142676712ed190e9a3441:/web/static/seepark_web.js?ds=sidebyside diff --git a/web/static/seepark_web.js b/web/static/seepark_web.js index 73e9ac2..904810a 100644 --- a/web/static/seepark_web.js +++ b/web/static/seepark_web.js @@ -17,7 +17,11 @@ var chart = c3.generate({ '0316a2193bff': 'Wassertemperatur in 4 m Tiefe', '0316a21383ff': 'Wassertemperatur in 5 m Tiefe' }, - xFormat: '%Y-%m-%d %H:%M:%S' + xFormat: '%Y-%m-%d %H:%M:%S', + colors: { + '0316a2193bff': 'lightblue', + '0316a21383ff': 'darkblue' + } }, axis: { x: { @@ -47,16 +51,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: { @@ -67,7 +68,7 @@ var chart = c3.generate({ return res; }, value: function (value, ratio, id, index) { - return value + '°'; + return value.toFixed(2) + '°'; } } },