Explorar o código

Merge branch 'master' of https://github.com/thattolleyguy/grafana into thattolleyguy-master

Alexander Zobnin %!s(int64=7) %!d(string=hai) anos
pai
achega
ece9eb54b9
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  1. 9 1
      public/app/plugins/panel/heatmap/heatmap_tooltip.ts

+ 9 - 1
public/app/plugins/panel/heatmap/heatmap_tooltip.ts

@@ -153,7 +153,15 @@ export class HeatmapTooltip {
 
 
   getXBucketIndex(offsetX, data) {
   getXBucketIndex(offsetX, data) {
     let x = this.scope.xScale.invert(offsetX - this.scope.yAxisWidth).valueOf();
     let x = this.scope.xScale.invert(offsetX - this.scope.yAxisWidth).valueOf();
-    let xBucketIndex = getValueBucketBound(x, data.xBucketSize, 1);
+    let xBucket = _.find(data.buckets, (bucket, bucketIndex) => {
+      return x-bucket.x <= data.xBucketSize && x-bucket.x >0;
+    });
+    let xBucketIndex;
+    if (!xBucket) {
+      xBucketIndex = getValueBucketBound(x, data.xBucketSize, 1);
+    } else {
+      xBucketIndex = xBucket.x;
+    }
     return xBucketIndex;
     return xBucketIndex;
   }
   }