From 40ac2a6c4fc024884658fc6f4647dee3b4648114 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Wed, 10 May 2023 08:21:48 +0100 Subject: [PATCH] [v10.0.x] Heatmap: Fix color rendering for value ranges < 1 (#68164) Heatmap: Fix color rendering for value ranges < 1 (#68156) (cherry picked from commit 1400a0a3f7a5b5b3c5b7258a3b5bb037b654f599) Co-authored-by: Leon Sorokin --- public/app/plugins/panel/heatmap/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/plugins/panel/heatmap/utils.ts b/public/app/plugins/panel/heatmap/utils.ts index da83e954125..5cf14c381ca 100644 --- a/public/app/plugins/panel/heatmap/utils.ts +++ b/public/app/plugins/panel/heatmap/utils.ts @@ -967,7 +967,7 @@ export const boundedMinMax = ( }; export const valuesToFills = (values: number[], palette: string[], minValue: number, maxValue: number) => { - let range = Math.max(maxValue - minValue, 1); + let range = maxValue - minValue || 1; let paletteSize = palette.length;