mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
#10724 Fix finding the x bucket
This commit is contained in:
parent
a0d8e96fd1
commit
bde5499552
@ -153,7 +153,15 @@ export class HeatmapTooltip {
|
||||
|
||||
getXBucketIndex(offsetX, data) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user