From 274ef0b3f6dd1a1c80783383a8f2b115971c5851 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 8 Oct 2024 12:05:00 +0300 Subject: [PATCH] [SSE] Fix trendline option --- .../main/app/view/ChartSettingsDlg.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js b/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js index 433de714c9..a686924721 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js +++ b/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js @@ -244,7 +244,10 @@ define([ this.chShowEquation = new Common.UI.CheckBox({ el: $('#chart-dlg-chk-show-equation'), labelText: this.textShowEquation - }); + }).on('change', _.bind(function (checkbox, state) { + if (this.chartSettings) + this.chartSettings.putDisplayTrendlinesEquation(state==='checked'); + }, this)); // Vertical Axis this.cmbMinType = []; @@ -1513,11 +1516,13 @@ define([ this.chCategoryName.setValue(this.chartSettings.getShowCatName(), true); this.chValue.setValue(this.chartSettings.getShowVal(), true); - this.chShowEquation.setValue(this.chartSettings.getDisplayTrendlinesEquation(), true); - var value = props.getSeparator(); this.txtSeparator.setValue((value) ? value : ''); + value = this.chartSettings.getDisplayTrendlinesEquation(); + this.chShowEquation.setValue(value !== undefined ? !!value : 'indeterminate', true); + this.chShowEquation.setDisabled(value===null, true); + Common.UI.FocusManager.add(this, [this.cmbChartTitle, this.cmbLegendPos, this.cmbDataLabels, this.chSeriesName, this.chCategoryName, this.chValue, this.txtSeparator, this.cmbLines, this.chMarkers, this.chShowEquation]); // Vertical Axis @@ -1657,8 +1662,6 @@ define([ this.chartSettings.putShowCatName(this.chCategoryName.getValue()=='checked'); this.chartSettings.putShowVal(this.chValue.getValue()=='checked'); - this.chartSettings.putDisplayTrendlinesEquation(this.chShowEquation.getValue()=='checked'); - this.chartSettings.putSeparator(_.isEmpty(this.txtSeparator.getValue()) ? ' ' : this.txtSeparator.getValue()); this.chMarkers.isVisible() && this.chartSettings.putShowMarker(this.chMarkers.getValue()=='checked');