From 9655d6ab2ccce56f61b3de05b1eadd6f5e8a20b3 Mon Sep 17 00:00:00 2001 From: David Moreno Lumbreras Date: Fri, 16 Nov 2018 12:35:42 +0100 Subject: [PATCH] Fix bug when using filters as aggregation --- public/kbn_dotplot_controller.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/kbn_dotplot_controller.js b/public/kbn_dotplot_controller.js index 9039f8a..6faaa99 100644 --- a/public/kbn_dotplot_controller.js +++ b/public/kbn_dotplot_controller.js @@ -29,14 +29,18 @@ module.controller('KbnDotplotVisController', function ($scope, $element, $timeou var dicColor = {} //Names of the field that have been selected var firstFieldAggId = $scope.vis.aggs.bySchemaName['field'][0].id; - var fieldAggName = $scope.vis.aggs.bySchemaName['field'][0].params.field.displayName; + if ($scope.vis.aggs.bySchemaName['field'][0].params.field) { + var fieldAggName = $scope.vis.aggs.bySchemaName['field'][0].params.field.displayName; + } if($scope.vis.aggs.bySchemaName['field'][1]){ id_secondfield = '1' id_x = '2' id_y = '3' id_size = '4' var secondFieldAggId = $scope.vis.aggs.bySchemaName['field'][1].id; - var secondfieldAggName = $scope.vis.aggs.bySchemaName['field'][1].params.field.displayName; + if ($scope.vis.aggs.bySchemaName['field'][1].params.field) { + var secondfieldAggName = $scope.vis.aggs.bySchemaName['field'][1].params.field.displayName; + } }