williaster closed pull request #5055: Fixing tooltip displaying metrics in heatmap URL: https://github.com/apache/incubator-superset/pull/5055
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): 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 += '<div><b>' + fd.all_columns_x + ': </b>' + obj.x + '<div>'; s += '<div><b>' + fd.all_columns_y + ': </b>' + obj.y + '<div>'; - s += '<div><b>' + fd.metric + ': </b>' + valueFormatter(obj.v) + '<div>'; + s += '<div><b>' + metric + ': </b>' + valueFormatter(obj.v) + '<div>'; if (fd.show_perc) { s += '<div><b>%: </b>' + fp(fd.normalized ? obj.rank : obj.perc) + '<div>'; } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org