Set tooltip to show extent of sparkData (#3626)

* Set tooltip to show extent of sparkData

* Using d3format instead of round
This commit is contained in:
michellethomas 2017-10-10 11:53:53 -07:00 committed by Maxime Beauchemin
parent bd45e3b19a
commit 80eb9c2c64
1 changed files with 3 additions and 2 deletions

View File

@ -73,8 +73,9 @@ function viz(slice, payload) {
sparkData.push(data[i][metric] / data[i - c.timeRatio][metric]);
}
}
const extent = d3.extent(data, d => d[metric]);
const tooltip = `min: ${extent[0]}, max: ${extent[1]}`;
const extent = d3.extent(sparkData);
const tooltip = `min: ${d3format(c.d3format, extent[0])}, \
max: ${d3format(c.d3format, extent[1])}`;
row[c.key] = (
<TooltipWrapper label="tt-spark" tooltip={tooltip}>
<div>