From 280200f8341757923aef1a1de9cf8b174c16cd66 Mon Sep 17 00:00:00 2001 From: michellethomas Date: Mon, 11 Jun 2018 17:14:02 -0700 Subject: [PATCH] Fixing tooltip displaying metrics in heatmap (#5055) --- superset/assets/src/visualizations/heatmap.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/assets/src/visualizations/heatmap.js b/superset/assets/src/visualizations/heatmap.js index 7d471d5d80..c26291ffca 100644 --- a/superset/assets/src/visualizations/heatmap.js +++ b/superset/assets/src/visualizations/heatmap.js @@ -177,11 +177,12 @@ function heatmapVis(slice, payload) { const k = d3.mouse(this); const m = Math.floor(scale[0].invert(k[0])); const n = Math.floor(scale[1].invert(k[1])); + const metric = typeof fd.metric === 'object' ? fd.metric.label : fd.metric; if (m in matrix && n in matrix[m]) { const obj = matrix[m][n]; s += '
' + fd.all_columns_x + ': ' + obj.x + '
'; s += '
' + fd.all_columns_y + ': ' + obj.y + '
'; - s += '
' + fd.metric + ': ' + valueFormatter(obj.v) + '
'; + s += '
' + metric + ': ' + valueFormatter(obj.v) + '
'; if (fd.show_perc) { s += '
%: ' + fp(fd.normalized ? obj.rank : obj.perc) + '
'; }