Fix string value displaying NaN (#6534)

This commit is contained in:
Mars 2018-12-18 09:03:51 +08:00 committed by Maxime Beauchemin
parent 9ec3e18ecb
commit 95cdda4482
1 changed files with 9 additions and 1 deletions

View File

@ -174,7 +174,15 @@ function TableVis(element, props) {
return null;
})
.classed('text-right', d => d.isMetric)
.attr('title', d => (!Number.isNaN(d.val) ? formatValue(d.val) : null))
.attr('title', (d) => {
if (typeof d.val === 'string') {
return d.val;
}
if (!Number.isNaN(d.val)) {
return formatValue(d.val);
}
return null;
})
.attr('data-sort', d => (d.isMetric) ? d.val : null)
// Check if the dashboard currently has a filter for each row
.classed('filtered', d =>