mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'master' of https://github.com/thattolleyguy/grafana into thattolleyguy-master
This commit is contained in:
commit
ece9eb54b9
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user