Skip to content

Commit

Permalink
making grouped/overlap the default mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Nov 3, 2016
1 parent c15667e commit e046000
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
8 changes: 2 additions & 6 deletions src/ui/public/vislib/visualizations/point_series.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

};

/**
Expand Down

0 comments on commit e046000

Please sign in to comment.