Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Fixing tooltip displaying metrics in heatmap (apache#5055)
Browse files Browse the repository at this point in the history
  • Loading branch information
michellethomas authored and timifasubaa committed Jul 25, 2018
1 parent 6ba8761 commit 4a0b363
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion superset/assets/src/visualizations/heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>';
}
Expand Down

0 comments on commit 4a0b363

Please sign in to comment.