Commit adb97a0f by Torkel Ödegaard

Fixes #42 : Auto Y scale is working as it should (even when using line fill)

parent f2f435b4
...@@ -87,8 +87,8 @@ function (angular, $, kbn, moment, _) { ...@@ -87,8 +87,8 @@ function (angular, $, kbn, moment, _) {
stack: scope.panel.percentage ? null : stack, stack: scope.panel.percentage ? null : stack,
lines: { lines: {
show: scope.panel.lines, show: scope.panel.lines,
// Silly, but fixes bug in stacked percentages zero: false,
fill: scope.panel.fill === 0 ? 0.001 : scope.panel.fill/10, fill: scope.panel.fill === 0 ? false : scope.panel.fill/10,
lineWidth: scope.panel.linewidth, lineWidth: scope.panel.linewidth,
steps: scope.panel.steppedLine steps: scope.panel.steppedLine
}, },
...@@ -186,9 +186,11 @@ function (angular, $, kbn, moment, _) { ...@@ -186,9 +186,11 @@ function (angular, $, kbn, moment, _) {
elem.html('<img src="' + url + '"></img>'); elem.html('<img src="' + url + '"></img>');
} }
function addAnnotations(options) { function addAnnotations(options) {
if(scope.panel.annotate.enable) { if(!scope.panel.annotate.enable) {
return;
}
options.events = { options.events = {
levels: 1, levels: 1,
data: scope.annotations, data: scope.annotations,
...@@ -205,7 +207,6 @@ function (angular, $, kbn, moment, _) { ...@@ -205,7 +207,6 @@ function (angular, $, kbn, moment, _) {
} }
}; };
} }
}
function addAxisLabels() { function addAxisLabels() {
if (scope.panel.leftYAxisLabel) { if (scope.panel.leftYAxisLabel) {
...@@ -224,8 +225,8 @@ function (angular, $, kbn, moment, _) { ...@@ -224,8 +225,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: null,
max: scope.panel.percentage && scope.panel.stack ? 100 : scope.panel.grid.max, max: null,
}; };
options.yaxes.push(defaults); options.yaxes.push(defaults);
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
</div> </div>
<div class="editor-option"> <div class="editor-option">
<label class="small">Left Y Format <tip>Y-axis formatting</tip></label> <label class="small">Left Y Format <tip>Y-axis formatting</tip></label>
<select class="input-small" ng-model="panel.y_formats[1]" ng-options="f for f in ['none','short','bytes', 'ms']" ng-change="render()"></select> <select class="input-small" ng-model="panel.y_formats[0]" ng-options="f for f in ['none','short','bytes', 'ms']" ng-change="render()"></select>
</div> </div>
<div class="editor-option"> <div class="editor-option">
<label class="small">Right Y Format <tip>Y-axis formatting</tip></label> <label class="small">Right Y Format <tip>Y-axis formatting</tip></label>
<select class="input-small" ng-model="panel.y_formats[2]" ng-options="f for f in ['none','short','bytes', 'ms']" ng-change="render()"></select> <select class="input-small" ng-model="panel.y_formats[1]" ng-options="f for f in ['none','short','bytes', 'ms']" ng-change="render()"></select>
</div> </div>
<div class="editor-option"> <div class="editor-option">
......
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