Commit d242ff88 authored by Julia Radzhabova's avatar Julia Radzhabova

[SSE] Fix Bug 32854.

parent 2a8147b2
...@@ -90,6 +90,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' ...@@ -90,6 +90,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.horAxisProps = null; this.horAxisProps = null;
this.currentAxisProps = null; this.currentAxisProps = null;
this.dataRangeValid = ''; this.dataRangeValid = '';
this.currentChartType = this._state.ChartType;
}, },
render: function() { render: function() {
...@@ -839,6 +840,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' ...@@ -839,6 +840,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.updateAxisProps(rawData.type, true); this.updateAxisProps(rawData.type, true);
this.vertAxisProps = this.chartSettings.getVertAxisProps(); this.vertAxisProps = this.chartSettings.getVertAxisProps();
this.horAxisProps = this.chartSettings.getHorAxisProps(); this.horAxisProps = this.chartSettings.getHorAxisProps();
this.updateDataLabels(rawData.type, this.cmbDataLabels.getValue());
this.currentChartType = rawData.type;
}, },
updateAxisProps: function(type, isDefault) { updateAxisProps: function(type, isDefault) {
...@@ -881,6 +884,44 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' ...@@ -881,6 +884,44 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.btnsCategory[3].options.contentTarget = (value || type == Asc.c_oAscChartTypeSettings.scatter) ? 'id-chart-settings-dlg-vert' : 'id-chart-settings-dlg-hor'; this.btnsCategory[3].options.contentTarget = (value || type == Asc.c_oAscChartTypeSettings.scatter) ? 'id-chart-settings-dlg-vert' : 'id-chart-settings-dlg-hor';
}, },
updateDataLabels: function(chartType, labelPos) {
if (chartType !== this.currentChartType) {
var data = [{ value: Asc.c_oAscChartDataLabelsPos.none, displayValue: this.textNone },
{ value: Asc.c_oAscChartDataLabelsPos.ctr, displayValue: this.textCenter }];
if (chartType == Asc.c_oAscChartTypeSettings.barNormal || chartType == Asc.c_oAscChartTypeSettings.hBarNormal)
data.push({ value: Asc.c_oAscChartDataLabelsPos.inBase, displayValue: this.textInnerBottom },
{ value: Asc.c_oAscChartDataLabelsPos.inEnd, displayValue: this.textInnerTop },
{ value: Asc.c_oAscChartDataLabelsPos.outEnd, displayValue: this.textOuterTop });
else if ( chartType == Asc.c_oAscChartTypeSettings.barStacked || chartType == Asc.c_oAscChartTypeSettings.barStackedPer ||
chartType == Asc.c_oAscChartTypeSettings.hBarStacked || chartType == Asc.c_oAscChartTypeSettings.hBarStackedPer )
data.push({ value: Asc.c_oAscChartDataLabelsPos.inBase, displayValue: this.textInnerBottom },
{ value: Asc.c_oAscChartDataLabelsPos.inEnd, displayValue: this.textInnerTop });
else if (chartType == Asc.c_oAscChartTypeSettings.lineNormal || chartType == Asc.c_oAscChartTypeSettings.lineStacked || chartType == Asc.c_oAscChartTypeSettings.lineStackedPer ||
chartType == Asc.c_oAscChartTypeSettings.stock || chartType == Asc.c_oAscChartTypeSettings.scatter)
data.push({ value: Asc.c_oAscChartDataLabelsPos.l, displayValue: this.textLeft },
{ value: Asc.c_oAscChartDataLabelsPos.r, displayValue: this.textRight },
{ value: Asc.c_oAscChartDataLabelsPos.t, displayValue: this.textTop },
{ value: Asc.c_oAscChartDataLabelsPos.b, displayValue: this.textBottom });
else if (chartType == Asc.c_oAscChartTypeSettings.pie || chartType == Asc.c_oAscChartTypeSettings.pie3d)
data.push({ value: Asc.c_oAscChartDataLabelsPos.bestFit, displayValue: this.textFit },
{ value: Asc.c_oAscChartDataLabelsPos.inEnd, displayValue: this.textInnerTop },
{ value: Asc.c_oAscChartDataLabelsPos.outEnd, displayValue: this.textOuterTop });
this.cmbDataLabels.setData(data);
}
if (labelPos!==undefined) {
var rec = this.cmbDataLabels.store.findWhere({value: labelPos});
if (!rec)
labelPos = Asc.c_oAscChartDataLabelsPos.ctr;
} else
labelPos = Asc.c_oAscChartDataLabelsPos.none;
this.cmbDataLabels.setValue(labelPos);
this.onSelectDataLabels(this.cmbDataLabels, {value:labelPos});
},
onVCategoryClick: function() { onVCategoryClick: function() {
(this.vertAxisProps.getAxisType()==Asc.c_oAscAxisType.val) ? this.fillVProps(this.vertAxisProps) : this.fillHProps(this.vertAxisProps); (this.vertAxisProps.getAxisType()==Asc.c_oAscAxisType.val) ? this.fillVProps(this.vertAxisProps) : this.fillHProps(this.vertAxisProps);
}, },
...@@ -1083,8 +1124,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' ...@@ -1083,8 +1124,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.cmbChartTitle.setValue(props.getTitle()); this.cmbChartTitle.setValue(props.getTitle());
this.cmbLegendPos.setValue(props.getLegendPos()); this.cmbLegendPos.setValue(props.getLegendPos());
this.cmbDataLabels.setValue(props.getDataLabelsPos()); this.updateDataLabels(this._state.ChartType, props.getDataLabelsPos());
this.onSelectDataLabels(this.cmbDataLabels, {value:props.getDataLabelsPos()});
this.chSeriesName.setValue(this.chartSettings.getShowSerName(), true); this.chSeriesName.setValue(this.chartSettings.getShowSerName(), true);
this.chCategoryName.setValue(this.chartSettings.getShowCatName(), true); this.chCategoryName.setValue(this.chartSettings.getShowCatName(), true);
...@@ -1100,6 +1140,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' ...@@ -1100,6 +1140,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.horAxisProps = props.getHorAxisProps(); this.horAxisProps = props.getHorAxisProps();
this.updateAxisProps(this._state.ChartType); this.updateAxisProps(this._state.ChartType);
this.currentChartType = this._state.ChartType;
} }
}, },
...@@ -1330,6 +1371,11 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template' ...@@ -1330,6 +1371,11 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
textAxisSettings: 'Axis Settings', textAxisSettings: 'Axis Settings',
textGridLines: 'Gridlines', textGridLines: 'Gridlines',
textShow: 'Show', textShow: 'Show',
textHide: 'Hide' textHide: 'Hide',
textLeft: 'Left',
textRight: 'Right',
textTop: 'Top',
textBottom: 'Bottom',
textFit: 'Fit Width'
}, SSE.Views.ChartSettingsDlg || {})); }, SSE.Views.ChartSettingsDlg || {}));
}); });
...@@ -411,6 +411,11 @@ ...@@ -411,6 +411,11 @@
"SSE.Views.ChartSettingsDlg.textXAxisTitle": "X Axis Title", "SSE.Views.ChartSettingsDlg.textXAxisTitle": "X Axis Title",
"SSE.Views.ChartSettingsDlg.textYAxisTitle": "Y Axis Title", "SSE.Views.ChartSettingsDlg.textYAxisTitle": "Y Axis Title",
"SSE.Views.ChartSettingsDlg.txtEmpty": "This field is required", "SSE.Views.ChartSettingsDlg.txtEmpty": "This field is required",
"SSE.Views.ChartSettingsDlg.textLeft": "Left",
"SSE.Views.ChartSettingsDlg.textRight": "Right",
"SSE.Views.ChartSettingsDlg.textTop": "Top",
"SSE.Views.ChartSettingsDlg.textBottom": "Bottom",
"SSE.Views.ChartSettingsDlg.textFit": "Fit Width",
"SSE.Views.DigitalFilterDialog.cancelButtonText": "Cancel", "SSE.Views.DigitalFilterDialog.cancelButtonText": "Cancel",
"SSE.Views.DigitalFilterDialog.capAnd": "And", "SSE.Views.DigitalFilterDialog.capAnd": "And",
"SSE.Views.DigitalFilterDialog.capCondition1": "equals", "SSE.Views.DigitalFilterDialog.capCondition1": "equals",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment