diff --git a/apps/spreadsheeteditor/main/app/view/ChartDataDialog.js b/apps/spreadsheeteditor/main/app/view/ChartDataDialog.js index 8a0ef6fd4b..419d85ce67 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartDataDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ChartDataDialog.js @@ -278,6 +278,7 @@ define([ (len>0) && this.categoryList.selectByIndex(0); } this.updateButtons(); + this.updateCatButtons(); }, getSettings: function () { @@ -412,6 +413,7 @@ define([ }, onSelectSeries: function(lisvView, itemView, record) { + this.updateCatButtons(record.get('series').asc_IsScatter()); this.updateMoveButtons(); }, @@ -422,8 +424,12 @@ define([ this.updateMoveButtons(); }, - updateCatButtons: function() { - this.btnEditCategory.setDisabled(this.categoryList.store.length<1); + updateCatButtons: function(isScatter) { + if (isScatter===undefined) { + var rec = this.seriesList.getSelectedRec(); + rec && (isScatter = rec.get('series').asc_IsScatter()); + } + this.btnEditCategory.setDisabled(this.categoryList.store.length<1 || !!isScatter); }, updateMoveButtons: function() { @@ -483,7 +489,7 @@ define([ var changedValue = dlg.getSettings(); } }; - this.changeDataRange(0, false, handlerDlg); + this.changeDataRange(0, {category: '', values: this.chartSettings.getCatValues()}, false, handlerDlg); }, changeDataRange: function(type, props, add, handlerDlg) { diff --git a/apps/spreadsheeteditor/main/app/view/ChartDataRangeDialog.js b/apps/spreadsheeteditor/main/app/view/ChartDataRangeDialog.js index 4ac3e2cf8a..301608e360 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartDataRangeDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ChartDataRangeDialog.js @@ -193,6 +193,10 @@ define([ this.inputRange2.setValue(series.asc_getValues()); (this.inputRange2.getValue()!=='') && this.lblRange2.html('= ' + series.asc_getValuesArr().join('; ')); } + } else { + this.inputRange1.setValue(this.props.category || ''); + // if (this.inputRange1.getValue()!=='') + this.props.values && this.lblRange1.html('= ' + this.props.values.join('; ')); } }, @@ -244,7 +248,9 @@ define([ if (state == 'ok') { if (this.inputRange1.checkValidate() !== true) return; - if (type==1 && this.inputRange2.checkValidate() !== true) + if (this.type==1 && this.inputRange2.checkValidate() !== true) + return; + if (this.type==1 && this.isScatter && this.inputRange3.checkValidate() !== true) return; } if (this.options.handler.call(this, this, state))