Przeglądaj źródła

fix(graph): fixed issue with y-axis labels overlapping with the yaxis, fixes #4626

Torkel Ödegaard 9 lat temu
rodzic
commit
5d9c3d595f
2 zmienionych plików z 5 dodań i 2 usunięć
  1. 1 0
      CHANGELOG.md
  2. 4 2
      public/app/plugins/panel/graph/graph.js

+ 1 - 0
CHANGELOG.md

@@ -9,6 +9,7 @@
 * **App Config**: Fixed app config issue showing content of other app config, fixes [#4575](https://github.com/grafana/grafana/issues/4575)
 * **Graph Panel**: Fixed legend option max not updating, fixes [#4601](https://github.com/grafana/grafana/issues/4601)
 * **Graph Panel**: Fixed issue where newly added graph panels shared same axes config, fixes [#4582](https://github.com/grafana/grafana/issues/4582)
+* **Graph Panel**: Fixed issue with axis labels overlapping Y-axis, fixes [#4626](https://github.com/grafana/grafana/issues/4626)
 
 # 3.0.0-beta2 (2016-04-04)
 

+ 4 - 2
public/app/plugins/panel/graph/graph.js

@@ -151,8 +151,10 @@ function (angular, $, moment, _, kbn, GraphTooltip) {
         }
 
         function processOffsetHook(plot, gridMargin) {
-          if (panel.yaxis) { gridMargin.left = 20; }
-          if (panel.rightYAxisLabel) { gridMargin.right = 20; }
+          var left = panel.yaxes[0];
+          var right = panel.yaxes[1];
+          if (left.show && left.label) { gridMargin.left = 20; }
+          if (right.show && right.label) { gridMargin.right = 20; }
         }
 
         // Function for rendering panel