From 8669599089324f6ff8c36fe04bd0d4fc844854a7 Mon Sep 17 00:00:00 2001 From: axe-felix Date: Sun, 9 Feb 2014 10:13:32 +0100 Subject: [PATCH] added support for 'less is worse' thresholds Sometimes you want to express 'less is worse' thresholds. That means setting the error threshold below the warning threshold. The problem was, that the error marking always went up to +Infinity. Concerns 16599a07a936569bfaabbcc57cf8087a01132cfa. --- src/app/directives/grafanaGraph.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/directives/grafanaGraph.js b/src/app/directives/grafanaGraph.js index 694ba02421d..6b13fa4c538 100644 --- a/src/app/directives/grafanaGraph.js +++ b/src/app/directives/grafanaGraph.js @@ -141,7 +141,12 @@ function (angular, $, kbn, moment, _) { }); if (panel.grid.threshold2) { - var limit2 = panel.grid.thresholdLine ? panel.grid.threshold2 : null; + var limit2; + if (panel.grid.thresholdLine) { + limit2 = panel.grid.threshold2; + } else { + limit2 = panel.grid.threshold1 > panel.grid.threshold2 ? -Infinity : +Infinity; + } options.grid.markings.push({ yaxis: { from: panel.grid.threshold2, to: limit2 }, color: panel.grid.threshold2Color @@ -340,4 +345,4 @@ function (angular, $, kbn, moment, _) { }; }); -}); \ No newline at end of file +});