From be98dc257a3ef3274f0e5ab91a0ce2f0b8395411 Mon Sep 17 00:00:00 2001 From: Joerg Lehmann Date: Sat, 4 Jan 2020 18:02:23 +0100 Subject: [PATCH] Percent values must not be more than 100 on scale --- snippets/graph.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/snippets/graph.html b/snippets/graph.html index 4a2357a..0ff9bab 100644 --- a/snippets/graph.html +++ b/snippets/graph.html @@ -161,6 +161,7 @@ function drawGraph(deveui, alias, property, start, stop, create_graph) { var label; var labels = {}; + var forceNiceScale = true; $(".button").removeClass("is-success"); if (property=="t") { $("#btn_t").addClass("is-success"); @@ -174,6 +175,7 @@ function drawGraph(deveui, alias, property, start, stop, create_graph) { mysubtitle = 'Akkuladung in Prozent'; minfunc = function(min) { return 0 } maxfunc = function(max) { return 100 } + forceNiceScale = false; } else if (property=="w") { $("#btn_w").addClass("is-success"); label = 'Gewicht'; @@ -191,6 +193,7 @@ function drawGraph(deveui, alias, property, start, stop, create_graph) { mysubtitle = 'Luftfeuchtigkeit in Prozent'; minfunc = function(min) { return 0 } maxfunc = function(max) { return 100 } + forceNiceScale = false; } else if (property=="p") { $("#btn_p").addClass("is-success"); label = 'Luftdruck'; @@ -238,7 +241,7 @@ function drawGraph(deveui, alias, property, start, stop, create_graph) { yaxis: { min: minfunc, max: maxfunc, - forceNiceScale: true, + forceNiceScale: forceNiceScale, labels: labels }, tooltip: {