diff --git a/src/core_plugins/kibana/public/visualize/editor/agg_params.js b/src/core_plugins/kibana/public/visualize/editor/agg_params.js index 664e665c3577d..64491ac50f12c 100644 --- a/src/core_plugins/kibana/public/visualize/editor/agg_params.js +++ b/src/core_plugins/kibana/public/visualize/editor/agg_params.js @@ -86,7 +86,7 @@ uiModules if (param.name === 'field') { fields = $aggParamEditorsScope.indexedFields = getIndexedFields(param); } else if (param.type === 'field') { - fields = $aggParamEditorsScope[param.name] = getIndexedFields(param); + fields = $aggParamEditorsScope[`${param.name}Options`] = getIndexedFields(param); } if (fields) { diff --git a/src/ui/public/agg_types/controls/top_sort.html b/src/ui/public/agg_types/controls/top_sort.html index dbb2e0362786c..6d66e7ce53255 100644 --- a/src/ui/public/agg_types/controls/top_sort.html +++ b/src/ui/public/agg_types/controls/top_sort.html @@ -8,9 +8,9 @@ name="sortField" required ng-model="agg.params.sortField" - ng-show="sortField.length" - auto-select-if-only-one="sortField" - ng-options="field as field.displayName group by field.type for field in sortField"> + ng-show="sortFieldOptions.length" + auto-select-if-only-one="sortFieldOptions" + ng-options="field as field.displayName group by field.type for field in sortFieldOptions"> diff --git a/src/ui/public/agg_types/metrics/top.js b/src/ui/public/agg_types/metrics/top.js index 498e862490cb6..a98767ac5d531 100644 --- a/src/ui/public/agg_types/metrics/top.js +++ b/src/ui/public/agg_types/metrics/top.js @@ -19,10 +19,7 @@ export default function AggTypeMetricTopProvider(Private) { if (vis.type.name === 'table') { return true; } - if (vis.type.name === 'pie') { - return value === 'number'; - } - return value === 'number' || value === 'date'; + return value === 'number'; }, write(agg, output) { output.params = {