[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>
</td>
</tr>
</table>
</div>
<div class="inner-content">
<table cols="1" style="width: 100%;">
<tr>
<td class="padding-small">
<td colspan=2 class="padding-small">
<label class="header"><%= scope.textLabelOptions %></label>
</td>
</tr>
<tr>
<td>
<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>
</tr>
</table>
@ -244,19 +249,24 @@
<div id="chart-dlg-combo-v-minor-type-1" class="input-group-nr" style="margin-left: 15px;"></div>
</td>
</tr>
</table>
</div>
<div class="inner-content">
<table cols="1" style="width: 100%;">
<tr>
<td class="padding-small">
<td colspan=2 class="padding-small">
<label class="header"><%= scope.textLabelOptions %></label>
</td>
</tr>
<tr>
<td>
<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>
</tr>
</table>
@ -362,11 +372,10 @@
</td>
</tr>
<tr>
<td width="140">
<div id="chart-dlg-combo-label-int-0" class="input-group-nr"></div>
</td>
<td style="vertical-align: bottom;">
<div id="chart-dlg-input-label-int-0" style="margin-left: 15px;"></div>
<td width="100%" colspan="2">
<div id="chart-dlg-combo-label-int-0" class="input-group-nr" style="display: inline-block;width: 100px;vertical-align: middle;"></div>
<div id="chart-dlg-input-label-int-0" style="display: inline-block;margin-left: 3px;width: 60px;vertical-align: middle;"></div>
<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>
</td>
</tr>
</table>
@ -472,11 +481,10 @@
</td>
</tr>
<tr>
<td width="140">
<div id="chart-dlg-combo-label-int-1" class="input-group-nr"></div>
</td>
<td style="vertical-align: bottom;">
<div id="chart-dlg-input-label-int-1" style="margin-left: 15px;"></div>
<td width="100%" colspan="2">
<div id="chart-dlg-combo-label-int-1" class="input-group-nr" style="display: inline-block;width: 100px;vertical-align: middle;"></div>
<div id="chart-dlg-input-label-int-1" style="display: inline-block;margin-left: 3px;width: 60px;vertical-align: middle;"></div>
<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>
</td>
</tr>
</table>

View file

@ -43,7 +43,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
'common/main/lib/component/CheckBox',
'common/main/lib/component/InputField',
'spreadsheeteditor/main/app/view/CellRangeDialog',
'spreadsheeteditor/main/app/view/ChartDataRangeDialog'
'spreadsheeteditor/main/app/view/ChartDataRangeDialog',
'spreadsheeteditor/main/app/view/FormatSettingsDialog'
], function (contentTemplate) {
'use strict';
@ -257,6 +258,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.cmbVertTitle = [];
this.cmbVertGrid = [];
this.chVertHide = [];
this.btnVFormat = [];
var addControlsV = function(i) {
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({
el: $('#chart-dlg-combo-v-label-pos-' + i),
cls: 'input-group-nr',
menuStyle: 'min-width: 140px;',
menuStyle: 'min-width: 100%;',
editable: false,
data: [
{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));
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(1);
@ -527,6 +533,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.cmbHorTitle = [];
this.cmbHorGrid = [];
this.chHorHide = [];
this.btnHFormat = [];
var addControlsH = function(i) {
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({
el: $('#chart-dlg-input-label-int-' + i),
width: 140,
width: 60,
maxValue: 1000000,
minValue: 1,
step: 1,
@ -740,7 +747,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
me.cmbLabelInterval[i] = new Common.UI.ComboBox({
el: $('#chart-dlg-combo-label-int-' + i),
cls: 'input-group-nr',
menuStyle: 'min-width: 140px;',
menuStyle: 'min-width: 100px;',
editable: false,
data: [
{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));
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(1);
@ -1642,7 +1653,6 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
}
},
onSelectLocationData: function() {
var me = this;
if (me.api) {
@ -1671,6 +1681,9 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
}
},
openFormat: function(props) {
},
show: function() {
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments);
@ -1815,7 +1828,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
textVertAxisSec: 'Secondary Vertical Axis',
textHorAxisSec: 'Secondary Horizontal Axis',
textAxisTitle: 'Title',
textHideAxis: 'Hide axis'
textHideAxis: 'Hide axis',
textFormat: 'Label format'
}, SSE.Views.ChartSettingsDlg || {}));
});