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 16599a07a9.
This commit is contained in:
axe-felix
2014-02-09 10:13:32 +01:00
parent 775c0ff2f1
commit 8669599089
+7 -2
View File
@@ -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, _) {
};
});
});
});