Commit 6ef03b7c by Andrew Rodgers

Revert "Revert "Added left and right min and max for y-axis""

This reverts commit 05303dab.
parent 05303dab
...@@ -258,8 +258,8 @@ function (angular, $, kbn, moment, _) { ...@@ -258,8 +258,8 @@ function (angular, $, kbn, moment, _) {
var defaults = { var defaults = {
position: 'left', position: 'left',
show: scope.panel['y-axis'], show: scope.panel['y-axis'],
min: scope.panel.grid.min, min: scope.panel.grid.leftMin,
max: scope.panel.percentage && scope.panel.stack ? 100 : scope.panel.grid.max, max: scope.panel.percentage && scope.panel.stack ? 100 : scope.panel.grid.leftMax,
}; };
options.yaxes.push(defaults); options.yaxes.push(defaults);
...@@ -267,6 +267,8 @@ function (angular, $, kbn, moment, _) { ...@@ -267,6 +267,8 @@ function (angular, $, kbn, moment, _) {
if (_.findWhere(data, {yaxis: 2})) { if (_.findWhere(data, {yaxis: 2})) {
var secondY = _.clone(defaults); var secondY = _.clone(defaults);
secondY.position = 'right'; 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); options.yaxes.push(secondY);
configureAxisMode(options.yaxes[1], scope.panel.y_formats[1]); configureAxisMode(options.yaxes[1], scope.panel.y_formats[1]);
} }
......
...@@ -36,12 +36,20 @@ ...@@ -36,12 +36,20 @@
<div class="section"> <div class="section">
<h5>Grid</h5> <h5>Grid</h5>
<div class="editor-option"> <div class="editor-option">
<label class="small">Min / <a ng-click="toggleGridMinMax('min')">Auto <i class="icon-star" ng-show="_.isNull(panel.grid.min)"></i></a></label> <label class="small">Left Y Min / <a ng-click="toggleGridMinMax('leftMin')">Auto <i class="icon-star" ng-show="_.isNull(panel.grid.leftMin)"></i></a></label>
<input type="number" class="input-small" ng-model="panel.grid.min" ng-change="render()" ng-model-onblur /> <input type="number" class="input-small" ng-model="panel.grid.leftMin" ng-change="render()" ng-model-onblur />
</div> </div>
<div class="editor-option"> <div class="editor-option">
<label class="small">Max / <a ng-click="toggleGridMinMax('max')">Auto <i class="icon-star" ng-show="_.isNull(panel.grid.max)"></i></a></label> <label class="small">Left Y Max / <a ng-click="toggleGridMinMax('leftMax')">Auto <i class="icon-star" ng-show="_.isNull(panel.grid.leftMax)"></i></a></label>
<input type="number" class="input-small" ng-model="panel.grid.max" ng-change="render()" ng-model-onblur /> <input type="number" class="input-small" ng-model="panel.grid.leftMax" ng-change="render()" ng-model-onblur />
</div>
<div class="editor-option">
<label class="small">Right Y Min / <a ng-click="toggleGridMinMax('rightMin')">Auto <i class="icon-star" ng-show="_.isNull(panel.grid.rightMin)"></i></a></label>
<input type="number" class="input-small" ng-model="panel.grid.rightMin" ng-change="render()" ng-model-onblur />
</div>
<div class="editor-option">
<label class="small">Right Y Max / <a ng-click="toggleGridMinMax('rightMax')">Auto <i class="icon-star" ng-show="_.isNull(panel.grid.rightMax)"></i></a></label>
<input type="number" class="input-small" ng-model="panel.grid.rightMax" ng-change="render()" ng-model-onblur />
</div> </div>
</div> </div>
......
...@@ -95,8 +95,10 @@ function (angular, app, $, _, kbn, moment, timeSeries) { ...@@ -95,8 +95,10 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
* grid.ma1::: Maximum y-axis value * grid.ma1::: Maximum y-axis value
*/ */
grid : { grid : {
max: null, leftMax: null,
min: null, rightMax: null,
leftMin: null,
rightMin: null,
threshold1: null, threshold1: null,
threshold2: null, threshold2: null,
threshold1Color: 'rgba(216, 200, 27, 0.27)', threshold1Color: 'rgba(216, 200, 27, 0.27)',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment