mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
fixing missing value display for number fields (#16644)
This commit is contained in:
parent
6d52c9d119
commit
3c898a58aa
1 changed files with 6 additions and 1 deletions
|
@ -65,6 +65,11 @@ export class MetricVisComponent extends Component {
|
|||
return isColorDark(parseInt(color[1]), parseInt(color[2]), parseInt(color[3]));
|
||||
}
|
||||
|
||||
_getFormattedValue(fieldFormatter, value) {
|
||||
if (_.isNaN(value)) return '-';
|
||||
return fieldFormatter(value);
|
||||
}
|
||||
|
||||
_processTableGroups(tableGroups) {
|
||||
const config = this.props.vis.params.metric;
|
||||
const isPercentageMode = config.percentageMode;
|
||||
|
@ -101,7 +106,7 @@ export class MetricVisComponent extends Component {
|
|||
}
|
||||
|
||||
if (aggConfig) {
|
||||
if (!isPercentageMode) value = aggConfig.fieldFormatter('html')(value);
|
||||
if (!isPercentageMode) value = this._getFormattedValue(aggConfig.fieldFormatter('html'), value);
|
||||
if (bucketAgg) {
|
||||
const bucketValue = bucketAgg.fieldFormatter('text')(row[0]);
|
||||
title = `${bucketValue} - ${aggConfig.makeLabel()}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue