From 0cebe8bf18204d17f311345744e67c4bf5961083 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Date: Tue, 28 Mar 2023 14:07:34 +0300 Subject: [PATCH] fix(legacy-plugin-chart-heatmap): fix adhoc column tooltip (#23507) --- .../legacy-plugin-chart-heatmap/src/Heatmap.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 f2e3624f0..b377c71c5 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js +++ b/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/Heatmap.js @@ -22,6 +22,8 @@ import PropTypes from 'prop-types'; import 'd3-svg-legend'; import d3tip from 'd3-tip'; import { + getColumnLabel, + getMetricLabel, getNumberFormatter, NumberFormats, getSequentialSchemeRegistry, @@ -44,8 +46,8 @@ const propTypes = { height: PropTypes.number, bottomMargin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), colorScheme: PropTypes.string, - columnX: PropTypes.string, - columnY: PropTypes.string, + columnX: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), + columnY: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), leftMargin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), metric: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), normalized: PropTypes.bool, @@ -338,12 +340,13 @@ function Heatmap(element, props) { const k = d3.mouse(this); const m = Math.floor(scale[0].invert(k[0])); const n = Math.floor(scale[1].invert(k[1])); - const metricLabel = typeof metric === 'object' ? metric.label : metric; if (m in matrix && n in matrix[m]) { const obj = matrix[m][n]; - s += `