From 5ae5fd32dbe4c5316a8da98e0215247fe48b8348 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 06:56:46 -0700 Subject: [PATCH] [v11.0.x] VizTooltip: Fix heatmap mode All (#86468) VizTooltip: Fix heatmap mode All (#86463) (cherry picked from commit 38fe9fcfd1316d0e07727a02938bf5f0d9864072) Co-authored-by: Adela Almasan <88068998+adela-almasan@users.noreply.github.com> --- public/app/plugins/panel/heatmap/HeatmapTooltip.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/panel/heatmap/HeatmapTooltip.tsx b/public/app/plugins/panel/heatmap/HeatmapTooltip.tsx index ed104d63f2f..5f3a6b6b53e 100644 --- a/public/app/plugins/panel/heatmap/HeatmapTooltip.tsx +++ b/public/app/plugins/panel/heatmap/HeatmapTooltip.tsx @@ -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); }