From e046000d2cf923132493a392629e2c449af06858 Mon Sep 17 00:00:00 2001 From: ppisljar Date: Mon, 31 Oct 2016 12:17:37 +0100 Subject: [PATCH] making grouped/overlap the default mode --- src/ui/public/vislib/visualizations/point_series.js | 8 ++------ .../vislib/visualizations/point_series/area_chart.js | 2 +- .../vislib/visualizations/point_series/column_chart.js | 7 ++++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/ui/public/vislib/visualizations/point_series.js b/src/ui/public/vislib/visualizations/point_series.js index 4a043f92b0a79..a02eedbec5cf2 100644 --- a/src/ui/public/vislib/visualizations/point_series.js +++ b/src/ui/public/vislib/visualizations/point_series.js @@ -38,13 +38,9 @@ export default function PointSeriesFactory(Private) { shouldBeStacked(seriesConfig) { const isHistogram = (seriesConfig.type === 'histogram'); const isArea = (seriesConfig.type === 'area'); - const isOverlapping = (seriesConfig.mode === 'overlap'); - const grouped = (seriesConfig.mode === 'grouped'); + const stacked = (seriesConfig.mode === 'stacked'); - const stackedHisto = isHistogram && !grouped; - const stackedArea = isArea && !isOverlapping; - - return stackedHisto || stackedArea; + return (isHistogram || isArea) && stacked; }; getStackedSeries(axis, series, first = false) { diff --git a/src/ui/public/vislib/visualizations/point_series/area_chart.js b/src/ui/public/vislib/visualizations/point_series/area_chart.js index 1282665fab1fc..baf6b89e22fe0 100644 --- a/src/ui/public/vislib/visualizations/point_series/area_chart.js +++ b/src/ui/public/vislib/visualizations/point_series/area_chart.js @@ -33,7 +33,7 @@ export default function AreaChartFactory(Private) { super(handler, chartEl, chartData); this.seriesConfig = _.defaults(seriesConfigArgs || {}, defaults); - this.isOverlapping = (this.seriesConfig.mode === 'overlap'); + this.isOverlapping = (this.seriesConfig.mode !== 'stacked'); if (this.isOverlapping) { // todo ... default opacity handler should check what the opacity is and then move back to it on mouseout diff --git a/src/ui/public/vislib/visualizations/point_series/column_chart.js b/src/ui/public/vislib/visualizations/point_series/column_chart.js index 7501b74a36b87..8c8cbe224eabe 100644 --- a/src/ui/public/vislib/visualizations/point_series/column_chart.js +++ b/src/ui/public/vislib/visualizations/point_series/column_chart.js @@ -75,10 +75,11 @@ export default function ColumnChartFactory(Private) { updateBars(bars) { const offset = this.seriesConfig.mode; - if (offset === 'grouped') { - return this.addGroupedBars(bars); + if (offset === 'stacked') { + return this.addStackedBars(bars); } - return this.addStackedBars(bars); + return this.addGroupedBars(bars); + }; /**