mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
corrected display of arrays in the metric vis
This commit is contained in:
parent
2a2fa67d2a
commit
eb70e84a56
2 changed files with 9 additions and 8 deletions
|
@ -21,7 +21,7 @@ describe('metric vis', function () {
|
|||
$scope.processTableGroups({
|
||||
tables: [{
|
||||
columns: [{ title: 'Count' }],
|
||||
rows: [[4301021]],
|
||||
rows: [[ { toString: () => formatter(4301021) } ]],
|
||||
aggConfig: function () {
|
||||
return {
|
||||
fieldFormatter: function () {
|
||||
|
@ -44,7 +44,7 @@ describe('metric vis', function () {
|
|||
{ title: '1st percentile of bytes' },
|
||||
{ title: '99th percentile of bytes' }
|
||||
],
|
||||
rows: [[182, 445842.4634666484]],
|
||||
rows: [[ { toString: () => formatter(182) }, { toString: () => formatter(445842.4634666484) } ]],
|
||||
aggConfig: function () {
|
||||
return {
|
||||
fieldFormatter: function () {
|
||||
|
|
|
@ -17,14 +17,11 @@ module.controller('KbnMetricVisController', function ($scope, $element, Private)
|
|||
$scope.processTableGroups = function (tableGroups) {
|
||||
tableGroups.tables.forEach(function (table) {
|
||||
table.columns.forEach(function (column, i) {
|
||||
const fieldFormatter = table.aggConfig(column).fieldFormatter();
|
||||
let value = table.rows[0][i];
|
||||
|
||||
value = isInvalid(value) ? '?' : fieldFormatter(value);
|
||||
const value = table.rows[0][i];
|
||||
|
||||
metrics.push({
|
||||
label: column.title,
|
||||
value: value
|
||||
value: value.toString('html')
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -32,8 +29,12 @@ module.controller('KbnMetricVisController', function ($scope, $element, Private)
|
|||
|
||||
$scope.$watch('esResponse', function (resp) {
|
||||
if (resp) {
|
||||
const options = {
|
||||
asAggConfigResults: true
|
||||
};
|
||||
|
||||
metrics.length = 0;
|
||||
$scope.processTableGroups(tabifyAggResponse($scope.vis, resp));
|
||||
$scope.processTableGroups(tabifyAggResponse($scope.vis, resp, options));
|
||||
$element.trigger('renderComplete');
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue