[SSE] Add format for axis label

This commit is contained in:
Julia Radzhabova 2020-12-07 16:22:18 +03:00
parent 6d626737af
commit 9f3b5efc9c
2 changed files with 50 additions and 28 deletions

View file

@ -139,19 +139,24 @@
<div id="chart-dlg-combo-v-minor-type-0" class="input-group-nr" style="margin-left: 15px;"></div> <div id="chart-dlg-combo-v-minor-type-0" class="input-group-nr" style="margin-left: 15px;"></div>
</td> </td>
</tr> </tr>
</table>
</div>
<div class="inner-content">
<table cols="1" style="width: 100%;">
<tr> <tr>
<td class="padding-small"> <td colspan=2 class="padding-small">
<label class="header"><%= scope.textLabelOptions %></label> <label class="header"><%= scope.textLabelOptions %></label>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<label class="input-label"><%= scope.textLabelPos %></label> <label class="input-label"><%= scope.textLabelPos %></label>
<div id="chart-dlg-combo-v-label-pos-0" class="input-group-nr" style="width:140px;"></div> </td>
<td>
</td>
</tr>
<tr>
<td>
<div id="chart-dlg-combo-v-label-pos-0" class="input-group-nr"></div>
</td>
<td>
<button type="button" class="btn btn-text-default auto" id="chart-dlg-btn-v-format-0" style="min-width: 100px;margin-left: 15px;"><%= scope.textFormat %></button>
</td> </td>
</tr> </tr>
</table> </table>
@ -244,19 +249,24 @@
<div id="chart-dlg-combo-v-minor-type-1" class="input-group-nr" style="margin-left: 15px;"></div> <div id="chart-dlg-combo-v-minor-type-1" class="input-group-nr" style="margin-left: 15px;"></div>
</td> </td>
</tr> </tr>
</table>
</div>
<div class="inner-content">
<table cols="1" style="width: 100%;">
<tr> <tr>
<td class="padding-small"> <td colspan=2 class="padding-small">
<label class="header"><%= scope.textLabelOptions %></label> <label class="header"><%= scope.textLabelOptions %></label>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
<label class="input-label"><%= scope.textLabelPos %></label> <label class="input-label"><%= scope.textLabelPos %></label>
<div id="chart-dlg-combo-v-label-pos-1" class="input-group-nr" style="width:140px;"></div> </td>
<td>
</td>
</tr>
<tr>
<td>
<div id="chart-dlg-combo-v-label-pos-1" class="input-group-nr" ></div>
</td>
<td>
<button type="button" class="btn btn-text-default auto" id="chart-dlg-btn-v-format-1" style="min-width: 100px;margin-left: 15px;"><%= scope.textFormat %></button>
</td> </td>
</tr> </tr>
</table> </table>
@ -362,11 +372,10 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="140"> <td width="100%" colspan="2">
<div id="chart-dlg-combo-label-int-0" class="input-group-nr"></div> <div id="chart-dlg-combo-label-int-0" class="input-group-nr" style="display: inline-block;width: 100px;vertical-align: middle;"></div>
</td> <div id="chart-dlg-input-label-int-0" style="display: inline-block;margin-left: 3px;width: 60px;vertical-align: middle;"></div>
<td style="vertical-align: bottom;"> <button type="button" class="btn btn-text-default auto" id="chart-dlg-btn-h-format-0" style="min-width:100px; margin-left: 5px;vertical-align: middle;float: right;"><%= scope.textFormat %></button>
<div id="chart-dlg-input-label-int-0" style="margin-left: 15px;"></div>
</td> </td>
</tr> </tr>
</table> </table>
@ -472,11 +481,10 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="140"> <td width="100%" colspan="2">
<div id="chart-dlg-combo-label-int-1" class="input-group-nr"></div> <div id="chart-dlg-combo-label-int-1" class="input-group-nr" style="display: inline-block;width: 100px;vertical-align: middle;"></div>
</td> <div id="chart-dlg-input-label-int-1" style="display: inline-block;margin-left: 3px;width: 60px;vertical-align: middle;"></div>
<td style="vertical-align: bottom;"> <button type="button" class="btn btn-text-default auto" id="chart-dlg-btn-h-format-1" style="min-width:100px; margin-left: 5px;vertical-align: middle;float: right;"><%= scope.textFormat %></button>
<div id="chart-dlg-input-label-int-1" style="margin-left: 15px;"></div>
</td> </td>
</tr> </tr>
</table> </table>

View file

@ -43,7 +43,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
'common/main/lib/component/CheckBox', 'common/main/lib/component/CheckBox',
'common/main/lib/component/InputField', 'common/main/lib/component/InputField',
'spreadsheeteditor/main/app/view/CellRangeDialog', 'spreadsheeteditor/main/app/view/CellRangeDialog',
'spreadsheeteditor/main/app/view/ChartDataRangeDialog' 'spreadsheeteditor/main/app/view/ChartDataRangeDialog',
'spreadsheeteditor/main/app/view/FormatSettingsDialog'
], function (contentTemplate) { ], function (contentTemplate) {
'use strict'; 'use strict';
@ -257,6 +258,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.cmbVertTitle = []; this.cmbVertTitle = [];
this.cmbVertGrid = []; this.cmbVertGrid = [];
this.chVertHide = []; this.chVertHide = [];
this.btnVFormat = [];
var addControlsV = function(i) { var addControlsV = function(i) {
me.chVertHide[i] = new Common.UI.CheckBox({ me.chVertHide[i] = new Common.UI.CheckBox({
@ -494,7 +496,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
me.cmbVLabelPos[i] = new Common.UI.ComboBox({ me.cmbVLabelPos[i] = new Common.UI.ComboBox({
el: $('#chart-dlg-combo-v-label-pos-' + i), el: $('#chart-dlg-combo-v-label-pos-' + i),
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 140px;', menuStyle: 'min-width: 100%;',
editable: false, editable: false,
data: [ data: [
{displayValue: me.textNone, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE}, {displayValue: me.textNone, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE},
@ -508,6 +510,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
me.currentAxisProps[i].putTickLabelsPos(record.value); me.currentAxisProps[i].putTickLabelsPos(record.value);
} }
}, me)); }, me));
me.btnVFormat[i] = new Common.UI.Button({
el: $('#chart-dlg-btn-v-format-' + i)
}).on('click', _.bind(me.openFormat, me, me.currentAxisProps[i]));
}; };
addControlsV(0); addControlsV(0);
addControlsV(1); addControlsV(1);
@ -527,6 +533,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.cmbHorTitle = []; this.cmbHorTitle = [];
this.cmbHorGrid = []; this.cmbHorGrid = [];
this.chHorHide = []; this.chHorHide = [];
this.btnHFormat = [];
var addControlsH = function(i) { var addControlsH = function(i) {
me.chHorHide[i] = new Common.UI.CheckBox({ me.chHorHide[i] = new Common.UI.CheckBox({
@ -721,7 +728,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
me.spnLabelInterval[i] = new Common.UI.MetricSpinner({ me.spnLabelInterval[i] = new Common.UI.MetricSpinner({
el: $('#chart-dlg-input-label-int-' + i), el: $('#chart-dlg-input-label-int-' + i),
width: 140, width: 60,
maxValue: 1000000, maxValue: 1000000,
minValue: 1, minValue: 1,
step: 1, step: 1,
@ -740,7 +747,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
me.cmbLabelInterval[i] = new Common.UI.ComboBox({ me.cmbLabelInterval[i] = new Common.UI.ComboBox({
el: $('#chart-dlg-combo-label-int-' + i), el: $('#chart-dlg-combo-label-int-' + i),
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 140px;', menuStyle: 'min-width: 100px;',
editable: false, editable: false,
data: [ data: [
{displayValue: me.textAuto, value: Asc.c_oAscBetweenLabelsRule.auto}, {displayValue: me.textAuto, value: Asc.c_oAscBetweenLabelsRule.auto},
@ -754,6 +761,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
me.spnLabelInterval[i].setValue(1, true); me.spnLabelInterval[i].setValue(1, true);
} }
}, me)); }, me));
me.btnHFormat[i] = new Common.UI.Button({
el: $('#chart-dlg-btn-h-format-' + i)
}).on('click', _.bind(me.openFormat, me, me.currentAxisProps[i]));
}; };
addControlsH(0); addControlsH(0);
addControlsH(1); addControlsH(1);
@ -1642,7 +1653,6 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
} }
}, },
onSelectLocationData: function() { onSelectLocationData: function() {
var me = this; var me = this;
if (me.api) { if (me.api) {
@ -1671,6 +1681,9 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
} }
}, },
openFormat: function(props) {
},
show: function() { show: function() {
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments); Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments);
@ -1815,7 +1828,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
textVertAxisSec: 'Secondary Vertical Axis', textVertAxisSec: 'Secondary Vertical Axis',
textHorAxisSec: 'Secondary Horizontal Axis', textHorAxisSec: 'Secondary Horizontal Axis',
textAxisTitle: 'Title', textAxisTitle: 'Title',
textHideAxis: 'Hide axis' textHideAxis: 'Hide axis',
textFormat: 'Label format'
}, SSE.Views.ChartSettingsDlg || {})); }, SSE.Views.ChartSettingsDlg || {}));
}); });