Commit 6e68c206 by Alexander Zobnin

Merge PR #10742

parents cf7be5da fd5e838f
...@@ -153,8 +153,12 @@ export class HeatmapTooltip { ...@@ -153,8 +153,12 @@ 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); // First try to find X bucket by checking x pos is in the
return xBucketIndex; // [bucket.x, bucket.x + xBucketSize] interval
let xBucket = _.find(data.buckets, bucket => {
return x > bucket.x && x - bucket.x <= data.xBucketSize;
});
return xBucket ? xBucket.x : getValueBucketBound(x, data.xBucketSize, 1);
} }
getYBucketIndex(offsetY, data) { getYBucketIndex(offsetY, data) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment