浏览代码

fix(graph): increase Y min and max range when series values are the same, (#6082)

fixes #6070, #6050.
Alexander Zobnin 9 年之前
父节点
当前提交
20f7eee8cc
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      public/vendor/flot/jquery.flot.js

+ 4 - 2
public/vendor/flot/jquery.flot.js

@@ -1663,8 +1663,10 @@ Licensed under the MIT license.
                 delta = max - min;
 
             if (delta == 0.0) {
-                // degenerate case
-                var widen = max == 0 ? 1 : 0.01;
+                // Grafana fix: wide Y min and max using increased wideFactor
+                // when all series values are the same
+                var wideFactor = 0.25;
+                var widen = max == 0 ? 1 : max * wideFactor;
 
                 if (opts.min == null)
                     min -= widen;