From 288c2626547704ae2891a1e8490a7a12add40162 Mon Sep 17 00:00:00 2001 From: Taylor Date: Tue, 10 May 2022 09:38:25 -0400 Subject: [PATCH] fix(chart & heatmap): make to fix that y label is rendering out of bounds --- .../plugins/legacy-plugin-chart-heatmap/src/Heatmap.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js b/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js index dc442039112e7..b0b32aba4a1ac 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js +++ b/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js @@ -111,7 +111,7 @@ function Heatmap(element, props) { let showY = true; let showX = true; const pixelsPerCharX = 4.5; // approx, depends on font size - const pixelsPerCharY = 6; // approx, depends on font size + let pixelsPerCharY = 6; // approx, depends on font size const valueFormatter = getNumberFormatter(numberFormat); @@ -121,6 +121,7 @@ function Heatmap(element, props) { let longestY = 1; records.forEach(datum => { + if (typeof datum.y === 'number') pixelsPerCharY = 7; longestX = Math.max( longestX, (datum.x && datum.x.toString().length) || 1,