You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by cc...@apache.org on 2018/06/12 00:14:06 UTC

[incubator-superset] branch master updated: Fixing tooltip displaying metrics in heatmap (#5055)

This is an automated email from the ASF dual-hosted git repository.

ccwilliams pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 280200f  Fixing tooltip displaying metrics in heatmap (#5055)
280200f is described below

commit 280200f8341757923aef1a1de9cf8b174c16cd66
Author: michellethomas <mi...@gmail.com>
AuthorDate: Mon Jun 11 17:14:02 2018 -0700

    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 7d471d5..c26291f 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>';
         }

-- 
To stop receiving notification emails like this one, please contact
ccwilliams@apache.org.