[v11.0.x] VizTooltip: Fix heatmap mode All (#86468)

VizTooltip: Fix heatmap mode All (#86463)

(cherry picked from commit 38fe9fcfd1)

Co-authored-by: Adela Almasan <88068998+adela-almasan@users.noreply.github.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-04-19 06:56:46 -07:00
committed by GitHub
co-authored by Adela Almasan
parent 9c604036e7
commit 5ae5fd32db
@@ -108,7 +108,11 @@ const HeatmapHoverCell = ({
let contentItems: VizTooltipItem[] = [];
const yValueIdx = index % (data.yBucketCount ?? 1);
const getYValueIndex = (idx: number) => {
return idx % (data.yBucketCount ?? 1);
};
let yValueIdx = getYValueIndex(index);
const xValueIdx = Math.floor(index / (data.yBucketCount ?? 1));
const getData = (idx: number = index) => {
@@ -178,6 +182,7 @@ const HeatmapHoverCell = ({
if (isSparse) {
({ xBucketMin, xBucketMax, yBucketMin, yBucketMax } = getSparseCellMinMax(data!, idx));
} else {
yValueIdx = getYValueIndex(idx);
getData(idx);
}