From 8743ba2886c52e1f3faa7aba52c71bff26a6507c Mon Sep 17 00:00:00 2001 From: Andrew Rodgers Date: Thu, 19 Jun 2014 21:49:49 +0000 Subject: [PATCH] Added left and right min and max for y-axis --- src/app/directives/grafanaGraph.js | 6 ++++-- src/app/panels/graph/axisEditor.html | 16 ++++++++++++---- src/app/panels/graph/module.js | 6 ++++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/app/directives/grafanaGraph.js b/src/app/directives/grafanaGraph.js index 95e2848a8b1..e7dec1abfd5 100755 --- a/src/app/directives/grafanaGraph.js +++ b/src/app/directives/grafanaGraph.js @@ -258,8 +258,8 @@ function (angular, $, kbn, moment, _) { var defaults = { position: 'left', show: scope.panel['y-axis'], - min: scope.panel.grid.min, - max: scope.panel.percentage && scope.panel.stack ? 100 : scope.panel.grid.max, + min: scope.panel.grid.leftMin, + max: scope.panel.percentage && scope.panel.stack ? 100 : scope.panel.grid.leftMax, }; options.yaxes.push(defaults); @@ -267,6 +267,8 @@ function (angular, $, kbn, moment, _) { if (_.findWhere(data, {yaxis: 2})) { var secondY = _.clone(defaults); secondY.position = 'right'; + secondY.min = scope.panel.grid.rightMin; + secondY.max = scope.panel.percentage && scope.panel.stack ? 100 : scope.panel.grid.rightMax; options.yaxes.push(secondY); configureAxisMode(options.yaxes[1], scope.panel.y_formats[1]); } diff --git a/src/app/panels/graph/axisEditor.html b/src/app/panels/graph/axisEditor.html index a87ffb435b2..e4f42687304 100644 --- a/src/app/panels/graph/axisEditor.html +++ b/src/app/panels/graph/axisEditor.html @@ -36,12 +36,20 @@
Grid
- - + +
- - + + +
+
+ + +
+
+ +
diff --git a/src/app/panels/graph/module.js b/src/app/panels/graph/module.js index 0533c97b98d..1964b8fe526 100644 --- a/src/app/panels/graph/module.js +++ b/src/app/panels/graph/module.js @@ -95,8 +95,10 @@ function (angular, app, $, _, kbn, moment, timeSeries) { * grid.ma1::: Maximum y-axis value */ grid : { - max: null, - min: null, + leftMax: null, + rightMax: null, + leftMin: null, + rightMin: null, threshold1: null, threshold2: null, threshold1Color: 'rgba(216, 200, 27, 0.27)',