Jelajahi Sumber

Merge pull request #11575 from alexanderzobnin/fix-11498

Histogram: fix invisible highest value bucket
Marcus Efraimsson 7 tahun lalu
induk
melakukan
b0349bc795
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 2 1
      public/app/plugins/panel/graph/graph.ts

+ 2 - 1
public/app/plugins/panel/graph/graph.ts

@@ -443,7 +443,8 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) {
 
           // Expand ticks for pretty view
           min = Math.floor(min / tickStep) * tickStep;
-          max = Math.ceil(max / tickStep) * tickStep;
+          // 1.01 is 101% - ensure we have enough space for last bar
+          max = Math.ceil(max * 1.01 / tickStep) * tickStep;
 
           ticks = [];
           for (let i = min; i <= max; i += tickStep) {