From 3aaf8278fecba4bf26db8c0ba6a3723ebf86f645 Mon Sep 17 00:00:00 2001 From: Squandor Date: Tue, 9 May 2017 11:39:59 +0200 Subject: [PATCH] added lux possibility for issue #99 for example: lux_inside = 96, year, lux --- templates/line_charts.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/templates/line_charts.html b/templates/line_charts.html index 0f983ac..9dd7d6b 100644 --- a/templates/line_charts.html +++ b/templates/line_charts.html @@ -27,9 +27,15 @@

Line Graph

$(document).ready(function() { {% for k, v in blockArray[count]["line_charts"].iteritems() %} - redrawLineChart("{{v[3]}}",{{v[1]}},"{{v[2]}}", line_chart_block_{{count}}); + var sensor = "{{v[3]}}"; + if ("{{v[3]}}" == 'lux') { + line_chart_block_{{count}}['options']['ykeys'][0] = 'lux_max'; + sensor = 'counter'; + } + + redrawLineChart(sensor,{{v[1]}},"{{v[2]}}", line_chart_block_{{count}}); $("div#title_block_{{count}} h2").html("{{k}}"); - setInterval(redrawLineChart,9000,"{{v[3]}}",{{v[1]}},"{{v[2]}}",line_chart_block_{{count}}); + setInterval(redrawLineChart,9000,sensor,{{v[1]}},"{{v[2]}}",line_chart_block_{{count}}); }); {% endfor %}