Jelajahi Sumber

Merge pull request #13659 from grafana/graph-time-format-fix

fix for graph time formating for Last 24h ranges
Torkel Ödegaard 7 tahun lalu
induk
melakukan
37548792f5
1 mengubah file dengan 3 tambahan dan 1 penghapusan
  1. 3 1
      public/app/plugins/panel/graph/graph.ts

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

@@ -713,7 +713,9 @@ class GraphElement {
     if (min && max && ticks) {
     if (min && max && ticks) {
       const range = max - min;
       const range = max - min;
       const secPerTick = range / ticks / 1000;
       const secPerTick = range / ticks / 1000;
-      const oneDay = 86400000;
+      // Need have 10 milisecond margin on the day range
+      // As sometimes last 24 hour dashboard evaluates to more than 86400000
+      const oneDay = 86400010;
       const oneYear = 31536000000;
       const oneYear = 31536000000;
 
 
       if (secPerTick <= 45) {
       if (secPerTick <= 45) {