fixes bad backport of #13659 (#13974) (#14091)

* fixing bad backport

* 5.x defaults to stacked histogram
This commit is contained in:
Peter Pisljar 2017-09-21 11:39:43 +02:00 committed by GitHub
parent fa09b20bac
commit b55100e46f
2 changed files with 7 additions and 6 deletions

View file

@ -99,6 +99,7 @@ export function VisProvider(Notifier, Private) {
_.cloneDeep(state.params || {}),
_.cloneDeep(this.type.params.defaults || {})
);
if (!this.params.type) this.params.type = this.type.name;
updateVisualizationConfig(state.params, this.params);

View file

@ -22,16 +22,16 @@ const updateVisualizationConfig = (stateConfig, config) => {
};
// update series options
const interpolate = config.smoothLines ? 'cardinal' : config.interpolate;
const stacked = ['stacked', 'percentage', 'wiggle', 'silhouette'].includes(config.mode);
const interpolate = config.smoothLines ? 'cardinal' : config.interpolate || 'linear';
const stacked = ['stacked', 'percentage', 'wiggle', 'silhouette'].includes(config.mode || 'stacked');
config.seriesParams[0] = {
...config.seriesParams[0],
type: config.type || 'line',
type: config.type || config.seriesParams[0].type,
mode: stacked ? 'stacked' : 'normal',
interpolate: interpolate,
drawLinesBetweenPoints: config.drawLinesBetweenPoints,
showCircles: config.showCircles,
radiusRatio: config.radiusRatio
drawLinesBetweenPoints: config.drawLinesBetweenPoints || config.seriesParams[0].drawLinesBetweenPoints,
showCircles: config.showCircles || config.seriesParams[0].showCircles,
radiusRatio: config.radiusRatio || config.seriesParams[0].radiusRatio
};
};