[SSE] Fix changing chart type

This commit is contained in:
Julia Radzhabova 2020-12-08 21:23:18 +03:00
parent 42a14bf6d0
commit 029ad640ac

View file

@ -279,9 +279,8 @@ define([
rawData = record; rawData = record;
} }
var isCombo = rawData.type==Asc.c_oAscChartTypeSettings.comboBarLine || rawData.type==Asc.c_oAscChartTypeSettings.comboBarLineSecondary || var isCombo = rawData.type==Asc.c_oAscChartTypeSettings.comboBarLine || rawData.type==Asc.c_oAscChartTypeSettings.comboBarLineSecondary ||
rawData.type==Asc.c_oAscChartTypeSettings.comboAreaBar || rawData.type==Asc.c_oAscChartTypeSettings.comboCustom, rawData.type==Asc.c_oAscChartTypeSettings.comboAreaBar || rawData.type==Asc.c_oAscChartTypeSettings.comboCustom;
series = isCombo ? this.chartSettings.getSeries() : []; if (isCombo && this.chartSettings.getSeries().length<2) {
if (isCombo && series.length<2) {
Common.UI.warning({msg: this.errorComboSeries, maxwidth: 600}); Common.UI.warning({msg: this.errorComboSeries, maxwidth: 600});
return; return;
} }
@ -291,7 +290,7 @@ define([
this.chartSettings.changeType(this.currentChartType); this.chartSettings.changeType(this.currentChartType);
this.ShowHideSettings(this.currentChartType); this.ShowHideSettings(this.currentChartType);
if (isCombo) if (isCombo)
this.updateSeriesList(series); this.updateSeriesList(this.chartSettings.getSeries());
else else
this.updateChartStyles(this.api.asc_getChartPreviews(this.currentChartType)); this.updateChartStyles(this.api.asc_getChartPreviews(this.currentChartType));
}, },