Skip to content

Commit

Permalink
added lux possibility for issue #99
Browse files Browse the repository at this point in the history
for example: lux_inside = 96, year, lux
  • Loading branch information
squandor committed May 9, 2017
1 parent a9d5b2e commit 3aaf827
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions templates/line_charts.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ <h2>Line Graph</h2>

$(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 %}
</script>

0 comments on commit 3aaf827

Please sign in to comment.