diff --git a/src/core_plugins/kbn_vislib_vis_types/public/area.js b/src/core_plugins/kbn_vislib_vis_types/public/area.js index bd655e1bdb1ee..98e9fcbc4a9a0 100644 --- a/src/core_plugins/kbn_vislib_vis_types/public/area.js +++ b/src/core_plugins/kbn_vislib_vis_types/public/area.js @@ -150,7 +150,7 @@ export default function PointSeriesVisType(Private) { name: 'group', title: 'Split Series', min: 0, - max: 1, + max: 3, aggFilter: ['!geohash_grid', '!filter'] }, { diff --git a/src/core_plugins/kbn_vislib_vis_types/public/histogram.js b/src/core_plugins/kbn_vislib_vis_types/public/histogram.js index dd4b356ab8f33..8af5440aaba68 100644 --- a/src/core_plugins/kbn_vislib_vis_types/public/histogram.js +++ b/src/core_plugins/kbn_vislib_vis_types/public/histogram.js @@ -151,7 +151,7 @@ export default function PointSeriesVisType(Private) { name: 'group', title: 'Split Series', min: 0, - max: 1, + max: 3, aggFilter: ['!geohash_grid', '!filter'] }, { diff --git a/src/core_plugins/kbn_vislib_vis_types/public/horizontal_bar.js b/src/core_plugins/kbn_vislib_vis_types/public/horizontal_bar.js index 6b6a2d6e7d5b6..c43d18446fac8 100644 --- a/src/core_plugins/kbn_vislib_vis_types/public/horizontal_bar.js +++ b/src/core_plugins/kbn_vislib_vis_types/public/horizontal_bar.js @@ -153,7 +153,7 @@ export default function PointSeriesVisType(Private) { name: 'group', title: 'Split Series', min: 0, - max: 1, + max: 3, aggFilter: ['!geohash_grid', '!filter'] }, { diff --git a/src/core_plugins/kbn_vislib_vis_types/public/line.js b/src/core_plugins/kbn_vislib_vis_types/public/line.js index fd72bd37ae37e..7e2c7aa759357 100644 --- a/src/core_plugins/kbn_vislib_vis_types/public/line.js +++ b/src/core_plugins/kbn_vislib_vis_types/public/line.js @@ -151,7 +151,7 @@ export default function PointSeriesVisType(Private) { name: 'group', title: 'Split Series', min: 0, - max: 1, + max: 3, aggFilter: ['!geohash_grid', '!filter'] }, { diff --git a/src/ui/public/agg_response/point_series/__tests__/_get_aspects.js b/src/ui/public/agg_response/point_series/__tests__/_get_aspects.js index 320276cd89412..6fcddaf3f1ef5 100644 --- a/src/ui/public/agg_response/point_series/__tests__/_get_aspects.js +++ b/src/ui/public/agg_response/point_series/__tests__/_get_aspects.js @@ -123,14 +123,6 @@ describe('getAspects', function () { }).to.throwError(TypeError); }); - it('throws an error if there are multiple series aspects', function () { - init(2, 1, 1); - - expect(function () { - getAspects(vis, table); - }).to.throwError(TypeError); - }); - it('creates a fake x aspect if the column does not exist', function () { init(0, 0, 1); diff --git a/src/ui/public/agg_response/point_series/_get_aspects.js b/src/ui/public/agg_response/point_series/_get_aspects.js index b05404255a18b..d1ef447eb830a 100644 --- a/src/ui/public/agg_response/point_series/_get_aspects.js +++ b/src/ui/public/agg_response/point_series/_get_aspects.js @@ -42,8 +42,8 @@ export function PointSeriesGetAspectsProvider(Private) { .transform(columnToAspect, {}) // unwrap groups that only have one value, and validate groups that have more .transform(function (aspects, group, name) { - if (name !== 'y' && group.length > 1) { - throw new TypeError('Only multiple metrics are supported in point series'); + if ((name !== 'y' && name !== 'series') && group.length > 1) { + throw new TypeError('Only multiple metrics and series are supported in point series'); } aspects[name] = group.length > 1 ? group : group[0]; diff --git a/src/ui/public/agg_response/point_series/_get_point.js b/src/ui/public/agg_response/point_series/_get_point.js index aaefcde145505..9a7a87a0e1b17 100644 --- a/src/ui/public/agg_response/point_series/_get_point.js +++ b/src/ui/public/agg_response/point_series/_get_point.js @@ -25,8 +25,9 @@ export function PointSeriesGetPointProvider() { } if (series) { - point.aggConfig = series.agg; - point.series = series.agg.fieldFormatter()(unwrap(row[series.i])); + const seriesArray = series.length ? series : [ series ]; + point.aggConfig = seriesArray[0].agg; + point.series = seriesArray.map(s => s.agg.fieldFormatter()(unwrap(row[s.i]))).join(' - '); } else if (y) { // If the data is not split up with a series aspect, then // each point's "series" becomes the y-agg that produced it