X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/blobdiff_plain/ebe2bb2492812aea5d73facd2a87cfb66e04ee3d..1f77d735ef62bbc45e79f692976397dfc19bfbb1:/web/static/seepark_web.js diff --git a/web/static/seepark_web.js b/web/static/seepark_web.js index e663296..33fb82d 100644 --- a/web/static/seepark_web.js +++ b/web/static/seepark_web.js @@ -88,10 +88,17 @@ function dayschart(element, title, days, xtickformat) { }, tooltip: { format: { + // TODO: maybe move to top name: function (name, ratio, id, index) { - var re = /\d m/; - var res = re.exec(name); - return res; + var prefix = ''; + if (element.substr(0, 7) == 'chart_w') { + var re = /\d m/; + prefix = 'Wasser '; + } else { + var re = /Luft/; + }; + var result = re.exec(name); + return prefix + result; }, value: function (value, ratio, id, index) { return value.toFixed(2) + '°'; @@ -138,9 +145,9 @@ function beginend(days) { dayschart('chart_water_1', 'Der See (Tag)', 1, '%H:%M'); dayschart('chart_water_7', 'Der See (Woche)', 7, '%a %d'); dayschart('chart_water_31', 'Der See (Monat)', 31, 'Woche %V'); -dayschart('chart_water_365', 'Der See (Jahr)', 365, '%b %d'); +dayschart('chart_water_365', 'Der See (Jahr)', 365, '%b %Y'); dayschart('chart_air_1', 'Die Luft (Tag)', 1, '%H:%M'); dayschart('chart_air_7', 'Die Luft (Woche)', 7, '%a %d'); dayschart('chart_air_31', 'Die Luft (Monat)', 31, 'Woche %V'); -dayschart('chart_air_365', 'Die Luft (Jahr)', 365, '%b %d'); +dayschart('chart_air_365', 'Die Luft (Jahr)', 365, '%b %Y');