From adb97a0f3e1aedd7ebc4be9d1fd342f08dd2f5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 7 Feb 2014 09:28:54 +0100 Subject: [PATCH] Fixes #42 : Auto Y scale is working as it should (even when using line fill) --- src/app/directives/grafanaGraph.js | 41 +++++++++++++------------ src/app/panels/graphite/axisEditor.html | 4 +-- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/app/directives/grafanaGraph.js b/src/app/directives/grafanaGraph.js index 6d6c6ae3148..d57002237e5 100644 --- a/src/app/directives/grafanaGraph.js +++ b/src/app/directives/grafanaGraph.js @@ -87,8 +87,8 @@ function (angular, $, kbn, moment, _) { stack: scope.panel.percentage ? null : stack, lines: { show: scope.panel.lines, - // Silly, but fixes bug in stacked percentages - fill: scope.panel.fill === 0 ? 0.001 : scope.panel.fill/10, + zero: false, + fill: scope.panel.fill === 0 ? false : scope.panel.fill/10, lineWidth: scope.panel.linewidth, steps: scope.panel.steppedLine }, @@ -186,25 +186,26 @@ function (angular, $, kbn, moment, _) { elem.html(''); } - function addAnnotations(options) { - if(scope.panel.annotate.enable) { - options.events = { - levels: 1, - data: scope.annotations, - types: { - 'annotation': { - level: 1, - icon: { - icon: "icon-tag icon-flip-vertical", - size: 20, - color: "#222", - outline: "#bbb" - } + if(!scope.panel.annotate.enable) { + return; + } + + options.events = { + levels: 1, + data: scope.annotations, + types: { + 'annotation': { + level: 1, + icon: { + icon: "icon-tag icon-flip-vertical", + size: 20, + color: "#222", + outline: "#bbb" } } - }; - } + } + }; } function addAxisLabels() { @@ -224,8 +225,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: null, + max: null, }; options.yaxes.push(defaults); diff --git a/src/app/panels/graphite/axisEditor.html b/src/app/panels/graphite/axisEditor.html index e2b1460f002..c2e1cc12347 100644 --- a/src/app/panels/graphite/axisEditor.html +++ b/src/app/panels/graphite/axisEditor.html @@ -10,11 +10,11 @@
- +
- +