diff --git a/apps/spreadsheeteditor/main/app/controller/ChartTab.js b/apps/spreadsheeteditor/main/app/controller/ChartTab.js index 16cedfb761..f92edcc8a0 100644 --- a/apps/spreadsheeteditor/main/app/controller/ChartTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ChartTab.js @@ -82,10 +82,51 @@ define([ 'charttab:widthchange': _.bind(this.onWidthChange, this), 'charttab:heightchange': _.bind(this.onHeightChange, this), 'charttab:ratio': _.bind(this.onToggleRatio, this), + 'charttab:3dsettings': _.bind(this.open3DSettings, this), }, }); }, + open3DSettings: function () { + if (this.view.btn3DSettings.isDisabled() || !Common.Controllers.LaunchController.isScriptLoaded()) return; + + var me = this; + var win, props; + if (me.api){ + props = (me.isChart) ? me.api.asc_getChartSettings() : me._originalProps; + if (props) { + var oView3D = props.getView3d(); + (new SSE.Views.Charts3DDlg( + { + oView3D: oView3D, + chartProps: props, + X: me._state.X, + Y: me._state.Y, + RightAngle: me._state.RightAngle, + Perspective: me._state.Perspective, + Depth: me._state.Depth, + Height3d: me._state.Height3d, + api: me.api, + handler: function(result, obj, props) { + if (result == 'ok') { + if (me.api) { + if (props) { + if (obj) { + props.startEdit(); + props.setView3d(obj); + props.endEdit(); + } + } + console.log(result) + } + } + Common.NotificationCenter.trigger('edit:complete', me); + } + })).show(); + } + } + }, + onToggleRatio: function (value) { if (value && this.view.spnHeight.getNumberValue()>0) { this._nRatio = this.view.spnWidth.getNumberValue()/this.view.spnHeight.getNumberValue(); @@ -113,9 +154,6 @@ define([ chartSettings = isChart ? this.api.asc_getChartSettings(true) : null, // don't lock chart object props3d = chartSettings ? chartSettings.getView3d() : null; - if ( this.isChart!==isChart || this._state.is3D!==!!props3d ) { - this.ShowHideElem(isChart, !!props3d); - } this._state.is3D=!!props3d; this.disableControls(this._locked); if (this.api && props){ @@ -191,59 +229,42 @@ define([ value = props3d.asc_getRotX(); if ((this._state.X===undefined || value===undefined)&&(this._state.X!==value) || Math.abs(this._state.X-value)>0.001) { - // this.spnX.setValue((value!==null && value !== undefined) ? value : '', true); this._state.X = value; } value = props3d.asc_getRotY(); if ( (this._state.Y===undefined || value===undefined)&&(this._state.Y!==value) || Math.abs(this._state.Y-value)>0.001) { - // this.spnY.setValue((value!==null && value !== undefined) ? value : '', true); this._state.Y = value; } value = props3d.asc_getRightAngleAxes(); if ( this._state.RightAngle!==value ) { - // this.chRightAngle.setValue((value !== null && value !== undefined) ? value : 'indeterminate', true); this._state.RightAngle=value; } value = props3d.asc_getPerspective(); if ( (this._state.Perspective===undefined || value===undefined)&&(this._state.Perspective!==value) || Math.abs(this._state.Perspective-value)>0.001) { - // this.spnPerspective.setMinValue((value!==null && value !== undefined) ? 0.1 : 0); - // this.spnPerspective.setValue((value!==null && value !== undefined) ? value : 0, true); this._state.Perspective = value; } - // this.spnPerspective.setDisabled(this._locked || !!this._state.RightAngle); - // this.btnNarrow.setDisabled(this._locked || !!this._state.RightAngle); - // this.btnWiden.setDisabled(this._locked || !!this._state.RightAngle); value = props3d.asc_getDepth(); if ( Math.abs(this._state.Depth-value)>0.001 || (this._state.Depth===undefined || value===undefined)&&(this._state.Depth!==value)) { - // this.spn3DDepth.setValue((value!==null && value !== undefined) ? value : '', true); this._state.Depth = value; } value = props3d.asc_getHeight(); if ( Math.abs(this._state.Height3d-value)>0.001 || (this._state.Height3d===undefined || this._state.Height3d===null || value===null)&&(this._state.Height3d!==value)) { - (value!==null) && this.spn3DHeight.setValue(value, true); - // this.chAutoscale.setValue(value===null, true); this._state.Height3d = value; } - // this.spn3DHeight.setDisabled(this._locked || value===null); } } } }, - ShowHideElem: function(isChart, is3D) { - // this.Chart3DContainer.toggleClass('settings-hidden', !isChart || !is3D); - this.fireEvent('updatescroller', this); - }, - updateMetricUnit: function() { if (this.spinners) { for (var i=0; i1584) { + this._state.LineWeight = -1; + setTimeout( function() { + Common.UI.error({ + msg: me.textBorderSizeErr, + callback: function() { + _.defer(function(btn) { + Common.NotificationCenter.trigger('edit:complete', me); + }) + } + }); + }, 10); + } + } else + this.applyBorderSize(record.value); + }, + + onBorderSizeSelected: function (combo, record) { + this.applyBorderSize(record.value); + }, + + applyBorderSize: function(value) { + value = Common.Utils.String.parseFloat(value); + value = isNaN(value) ? 1 : Math.max(0.01, Math.min(1584, value)); + + this.BorderSize = value; + if (this.api && !this._noApply && this._originalProps) { + var props = new Asc.sparklineGroup(); + props.asc_setLineWeight(this.BorderSize); + this.api.asc_setSparklineGroup(this._state.SparkId, props); + Common.NotificationCenter.trigger('edit:complete', this); + } + }, + + onClear: function (menu, item, e) { + if (item.value == Asc.c_oAscCleanOptions.Format && !this._state.wsProps['FormatCells'] || item.value == Asc.c_oAscCleanOptions.All && !this.api.asc_checkLockedCells()) + this.onClearCallback(menu, item); + else if (item.value == Asc.c_oAscCleanOptions.Comments) { + this._state.wsProps['Objects'] ? Common.NotificationCenter.trigger('showerror', Asc.c_oAscError.ID.ChangeOnProtectedSheet, Asc.c_oAscError.Level.NoCritical) : this.onClearCallback(menu, item); + } else + Common.NotificationCenter.trigger('protect:check', this.onClearCallback, this, [menu, item]); + }, + + onClearCallback: function (menu, item) { + if (this.api) { + if (item.value == Asc.c_oAscCleanOptions.Comments) { + this.api.asc_RemoveAllComments(!this.permissions.canDeleteComments, true);// 1 param = true if remove only my comments, 2 param - remove current comments + } else + this.api.asc_emptyCells(item.value, item.value == Asc.c_oAscCleanOptions.All && !this.permissions.canDeleteComments); + + Common.NotificationCenter.trigger('edit:complete', this); + } + }, + + onSelectMarkersColorMenu: function (item, color, index) { + if (this.api && !this._noApply && this._originalProps) { + var props = new Asc.sparklineGroup(); + switch (index) { + case 0: + props.asc_setHighPoint(true); + props.asc_setColorHigh(Common.Utils.ThemeColor.getRgbColor(color)); + break + case 1: + props.asc_setLowPoint(true); + props.asc_setColorLow(Common.Utils.ThemeColor.getRgbColor(color)); + break + case 2: + props.asc_setFirstPoint(true); + props.asc_setColorFirst(Common.Utils.ThemeColor.getRgbColor(color)); + break + case 3: + props.asc_setLastPoint(true); + props.asc_setColorLast(Common.Utils.ThemeColor.getRgbColor(color)); + break + case 4: + props.asc_setNegativePoint(true); + props.asc_setColorNegative(Common.Utils.ThemeColor.getRgbColor(color)); + break + case 5: + props.asc_setMarkersPoint(true); + props.asc_setColorMarkers(Common.Utils.ThemeColor.getRgbColor(color)); + break + } + this.api.asc_setSparklineGroup(this._state.SparkId, props); + } + Common.NotificationCenter.trigger('edit:complete', this); + }, + + onSelectSparklineColorMenu: function (menu, item) { + if (item.value === 1 && this.mnuSparklineColorPicker) { + this.mnuSparklineColorPicker.addNewColor(); + }; + }, + + onSelectSparkType: function (type) { + this._state.SparkType = -1; + if (this.api && !this._noApply && this._originalProps) { + var props = new Asc.sparklineGroup(); + props.asc_setType(type); + this.api.asc_setSparklineGroup(this._state.SparkId, props); + } + + this.view.btnLineType.toggle(type === 0); + this.view.btnColumnType.toggle(type === 1); + this.view.btnWinLossType.toggle(type === 2); + + Common.NotificationCenter.trigger('edit:complete', this); + }, + + onCheckPointChange: function(type, field, newValue, oldValue, eOpts) { + if (this.api && !this._noApply && this._originalProps) { + var props = new Asc.sparklineGroup(); + switch (type) { + case 0: + props.asc_setHighPoint(field=='checked'); + break; + case 1: + props.asc_setLowPoint(field=='checked'); + break; + case 2: + props.asc_setNegativePoint(field=='checked'); + break; + case 3: + props.asc_setFirstPoint(field=='checked'); + break; + case 4: + props.asc_setLastPoint(field=='checked'); + break; + case 5: + props.asc_setMarkersPoint(field=='checked'); + break; + } + this.api.asc_setSparklineGroup(this._state.SparkId, props); + } + Common.NotificationCenter.trigger('edit:complete', this); + }, + + createDelayedElements: function () { + var me = this + if (this.mnuSparklineColorPicker) return + + this.mnuSparklineColorPicker = new Common.UI.ThemeColorPalette({ + el: $('#sparkline-color-menu-picker'), + outerMenu: {menu: me.view.btnSparklineColor.menu, index: 0} + }); + this.view.btnSparklineColor.menu.setInnerMenu([{menu: this.mnuSparklineColorPicker, index: 0}]); + this.mnuSparklineColorPicker.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors()); + this.mnuSparklineColorPicker.on('select', _.bind(this.onSparklineColorSelect, this)); + }, + + onSparklineColorSelect: function (item, color) { + if (this.api && this._originalProps) { + var props = new Asc.sparklineGroup(); + props.asc_setColorSeries(Common.Utils.ThemeColor.getRgbColor(color)); + this.api.asc_setSparklineGroup(this._state.SparkId, props); + } + this.view.btnSparklineColor.menu.hide(); + Common.NotificationCenter.trigger('edit:complete', this); + }, + + ChangeSettings: function(props) { + this.createDelayedElements(); + this._props = props; + + var isChart = !!(props && props.asc_getChartProperties && props.asc_getChartProperties()), + chartSettings = isChart ? this.api.asc_getChartSettings(true) : null, // don't lock chart object + props3d = chartSettings ? chartSettings.getView3d() : null; + + this._state.is3D=!!props3d; + this.disableControls(this._locked); + + if (this.api && props){ + if (!isChart) { //sparkline + this._originalProps = props; + this.isChart = false; + this._state.SparkId = props.asc_getId(); + + var type = props.asc_getType(), + styleChanged = false; + if (this._state.SparkType !== type) { + this._state.SparkType = type; + this.view.btnLineType.toggle(type === 0); + this.view.btnColumnType.toggle(type === 1); + this.view.btnWinLossType.toggle(type === 2); + styleChanged = true; + } + + var w = props.asc_getLineWeight(), + check_value = (Math.abs(this._state.LineWeight-w)<0.001) && !((new RegExp(this.txtPt + '\\s*$')).test(this.view.cmbBorderSize.getRawValue())); + if ( Math.abs(this._state.LineWeight-w)>0.001 || check_value || + (this._state.LineWeight===null || w===null)&&(this._state.LineWeight!==w)) { + this._state.LineWeight = w; + + var _selectedItem = (w===null) ? w : _.find(this.view.cmbBorderSize.store.models, function(item) { + if ( witem.attributes.value-0.01) { + return true; + } + }); + if (_selectedItem) + this.view.cmbBorderSize.selectRecord(_selectedItem); + else { + this.view.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' ' + this.txtPt : ''); + } + this.BorderSize = w; + } + this.view.cmbBorderSize.setDisabled(this._state.SparkType!==Asc.c_oAscSparklineType.Line); + var color = props.asc_getColorSeries(); + + var point = props.asc_getMarkersPoint(); + color = props.asc_getColorMarkers(); + if ( this._state.MarkersPoint!==point ) { + this.view.chMarkers.setValue((point !== null && point !== undefined) ? point : 'indeterminate', true); + this._state.MarkersPoint=point; + styleChanged = true; + } + this.view.chMarkers.setDisabled(this._state.SparkType !== Asc.c_oAscSparklineType.Line, 'asd'); + // this.view.btnMarkerColor.setDisabled(this._state.SparkType!==Asc.c_oAscSparklineType.Line); + + point = props.asc_getHighPoint(); + color = props.asc_getColorHigh(); + if ( this._state.HighPoint!==point ) { + this.view.chHighPoint.setValue((point !== null && point !== undefined) ? point : 'indeterminate', true); + this._state.HighPoint=point; + styleChanged = true; + } + + point = props.asc_getLowPoint(); + color = props.asc_getColorLow(); + if ( this._state.LowPoint!==point ) { + this.view.chLowPoint.setValue((point !== null && point !== undefined) ? point : 'indeterminate', true); + this._state.LowPoint=point; + styleChanged = true; + } + + point = props.asc_getFirstPoint(); + color = props.asc_getColorFirst(); + if ( this._state.FirstPoint!==point ) { + this.view.chFirstPoint.setValue((point !== null && point !== undefined) ? point : 'indeterminate', true); + this._state.FirstPoint=point; + styleChanged = true; + } + + point = props.asc_getLastPoint(); + color = props.asc_getColorLast(); + if ( this._state.LastPoint!==point ) { + this.view.chLastPoint.setValue((point !== null && point !== undefined) ? point : 'indeterminate', true); + this._state.LastPoint=point; + styleChanged = true; + } + + point = props.asc_getNegativePoint(); + color = props.asc_getColorNegative(); + if ( this._state.NegativePoint!==point ) { + this.view.chNegativePoint.setValue((point !== null && point !== undefined) ? point : 'indeterminate', true); + this._state.NegativePoint=point; + styleChanged = true; + } + + if (styleChanged) + this.updateSparkStyles(props.asc_getStyles()); + this.updateMarkerColors() + } + } + }, + + updateMarkerColors: function () { + const colorSpans = this.view.$el.find('span.color'); + + if (!this._props) return; + + const colors = [ + this._props.asc_getColorHigh(), + this._props.asc_getColorLow(), + this._props.asc_getColorFirst(), + this._props.asc_getColorLast(), + this._props.asc_getColorNegative(), + this._props.asc_getColorMarkers() + ]; + + colorSpans.each((index, el) => { + const color = colors[index]; + if (color) { + const hex = (color.asc_getType() === Asc.c_oAscColor.COLOR_TYPE_SCHEME) + ? Common.Utils.ThemeColor.getHexColor(color.asc_getR(), color.asc_getG(), color.asc_getB()) + : Common.Utils.ThemeColor.getHexColor(color.asc_getR(), color.asc_getG(), color.asc_getB()); + $(el).css('background','#' + hex); + } + }); + const newcolorSpans = this.view.$el.find('span.color'); + }, + + openAdvancedSettings: function() { + // if (this.linkAdvanced.hasClass('disabled') || !Common.Controllers.LaunchController.isScriptLoaded()) return; + + var me = this; + var win, props; + if (me.api){ + props = (me.isChart) ? me.api.asc_getChartSettings() : me._originalProps; + if (props) { + (new SSE.Views.ChartSettingsDlg( + { + chartSettings: props, + imageSettings: (me.isChart) ? me._originalProps : null, + sparklineStyles: me.sparklineStyles, + isChart: me.isChart, + api: me.api, + handler: function(result, value) { + if (result == 'ok') { + if (me.api) { + if (me.isChart) { + if (value.imageSettings) { + value.imageSettings.asc_putChartProperties(value.chartSettings); + me.api.asc_setGraphicObjectProps(value.imageSettings); + } else + me.api.asc_applyChartSettings(value.chartSettings); + } else + me.api.asc_setSparklineGroup(me._state.SparkId, value.chartSettings); + } + } + Common.NotificationCenter.trigger('edit:complete', me); + } + })).show(); + } + } + }, + + updateSparkStyles: function(styles) { + var me = this; + + if (styles && styles.length>1){ + var stylesStore = this.view.cmbSparkStyle.menuPicker.store, + selectedIdx = styles[styles.length-1]; + this.sparklineStyles = styles; + if (stylesStore.length == styles.length-1) { + var data = stylesStore.models; + for (var i=0; i-1); + } + } }, disableControls: function(disable) { @@ -110,11 +484,6 @@ define([ } }, - ShowCombinedProps: function(type) { - // this.view.chartStyles.setVisible(!(type===null || type==Asc.c_oAscChartTypeSettings.comboBarLine || type==Asc.c_oAscChartTypeSettings.comboBarLineSecondary || - // type==Asc.c_oAscChartTypeSettings.comboAreaBar || type==Asc.c_oAscChartTypeSettings.comboCustom)); - }, - setApi: function(api) { if (api) { this.api = api; @@ -156,18 +525,9 @@ define([ onSelectionChanged: function(info) { if (this.rangeSelectionMode || !this.appConfig.isEdit || !this.view) return; - var selectType = info.asc_getSelectionType(); - var selectedObjects = this.api.asc_getGraphicObjectProps(); - if ((selectType == Asc.c_oAscSelectionType.RangeChart || selectType == Asc.c_oAscSelectionType.RangeChartText) && selectedObjects) - for (var i = 0; i < selectedObjects.length; i++) { - if (selectedObjects[i].asc_getObjectType() == Asc.c_oAscTypeSelectElement.Image) { - var elValue = selectedObjects[i].asc_getObjectValue(); - if ( elValue.asc_getChartProperties() ) { - // this.ChangeSettings(this.api.asc_getGraphicObjectProps()[i].asc_getObjectValue()); - break; - } - } - } + var sparkLineInfo = info.asc_getSparklineInfo(); + if (sparkLineInfo) + this.ChangeSettings(sparkLineInfo); }, onCellsRange: function(status) { diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 982c603497..2294f812fc 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -207,7 +207,8 @@ define([ isUserProtected: false, showPivotTab: false, showTableDesignTab: false, - showChartTab: false + showChartTab: false, + showSparklineTab: false }; this.binding = {}; @@ -1262,6 +1263,8 @@ define([ me.view && me.view.fireEvent('insertspark', me.view); if (settings.destination) me.api.asc_addSparklineGroup(type, settings.source, settings.destination); + + me.showSparklineTab = true; } Common.NotificationCenter.trigger('edit:complete', me); } @@ -3085,7 +3088,16 @@ define([ this.toolbar.setTab('charttab'); this._state.inchart = in_chart; } - if (in_chart) return; + + var in_sparkline = !!info.asc_getSparklineInfo(); + if (this._state.insparkline !== in_sparkline) { + if ( !in_sparkline && this.toolbar.isTabActive('sparklinetab') ) + this.toolbar.setTab('home'); + this.toolbar.setVisible('sparklinetab', !!in_sparkline); + if (in_sparkline && this._state.showSparklineTab) + this.toolbar.setTab('sparklinetab'); + this._state.insparkline = in_sparkline; + } if (!toolbar.mode.isEditDiagram) { @@ -4602,7 +4614,7 @@ define([ me.toolbar.btnsTableDesign = tabledesignbuttons; } - tab = {caption: 'Chart', action: 'charttab', extcls: config.isEdit ? 'canedit' : '', layoutname: 'toolbar-charttab', dataHintTitle: 'V', aux: true}; + tab = {caption: me.toolbar.textTabChart, action: 'charttab', extcls: config.isEdit ? 'canedit' : '', layoutname: 'toolbar-charttab', dataHintTitle: 'V', aux: true}; var charttab = me.getApplication().getController('ChartTab'); charttab.setApi(me.api).setConfig({toolbar: me}); var view = charttab.getView('ChartTab'); @@ -4614,7 +4626,7 @@ define([ Array.prototype.push.apply(me.toolbar.lockControls, chartbuttons); } - tab = {caption: 'Sparkline', action: 'sparklinetab', extcls: config.isEdit ? 'canedit' : '', layoutname: 'toolbar-sparklinetab', dataHintTitle: 'V', aux: true}; + tab = {caption: me.toolbar.textTabSparkline, action: 'sparklinetab', extcls: config.isEdit ? 'canedit' : '', layoutname: 'toolbar-sparklinetab', dataHintTitle: 'V', aux: true}; var sparklinetab = me.getApplication().getController('SparklineTab'); sparklinetab.setApi(me.api).setConfig({toolbar: me}); var view = sparklinetab.getView('SparklineTab'); @@ -5297,6 +5309,7 @@ define([ this._state.showPivotTab = tab === 'pivot'; this._state.showTableDesignTab = tab ==='tabledesign'; this._state.showChartTab = tab ==='charttab'; + this._state.showSparklineTab = tab ==='sparklinetab'; }, onTabCollapse: function(tab) { diff --git a/apps/spreadsheeteditor/main/app/view/ChartTab.js b/apps/spreadsheeteditor/main/app/view/ChartTab.js index 613aca6b77..1ba0d46d61 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartTab.js +++ b/apps/spreadsheeteditor/main/app/view/ChartTab.js @@ -86,6 +86,9 @@ define([ '
' + '
' + '
' + + '
' + + '' + + '
' + '
' + '' + '
' + @@ -115,6 +118,9 @@ define([ me.btnSwitchRowsCols.on('click', function (btn, e) { me.fireEvent('charttab:rowscols'); }); + me.btn3DSettings.on('click', function (btn, e) { + me.fireEvent('charttab:3dsettings'); + }); me.btnAdvancedSettings.on('click', function (btn, e) { me.fireEvent('charttab:advanced'); }); @@ -144,7 +150,7 @@ define([ menu: new Common.UI.Menu({ items: [ { - caption: 'Axes', + caption: me.textAxes, value: 'axes', disabled: false, menu: new Common.UI.Menu({ @@ -152,31 +158,31 @@ define([ menuAlign: 'tl-tr', items: [ { - caption: 'Horizontal Axis', + caption: me.textHorAxis, value: 'bShowHorAxis', stopPropagation: true, checkable: true }, { - caption: 'Vertical Axis', + caption: me.textVertAxis, value: 'bShowVertAxis', stopPropagation: true, checkable: true }, { - caption: 'Horizontal Axis Sec', + caption: me.textHorAxisSec, value: 'bShowHorAxSec', stopPropagation: true, checkable: true }, { - caption: 'Vertical Axis Sec', + caption: me.textVertAxisSec, value: 'bShowVertAxSec', stopPropagation: true, checkable: true }, { - caption: 'Depth Axes', + caption: me.DepthAxis, value: 'bShowDepthAxes', stopPropagation: true, checkable: true @@ -185,7 +191,7 @@ define([ }) }, { - caption: 'Axis Titles', + caption: me.textAxisTitles, value: 'axisTitles', disabled: false, menu: new Common.UI.Menu({ @@ -193,31 +199,31 @@ define([ menuAlign: 'tl-tr', items: [ { - caption:'Horizontal Axis', + caption:me.textHorAxis, value: 'bShowHorAxTitle', stopPropagation: true, checkable: true }, { - caption: 'Vertical Axis', + caption: me.textVertAxis, value: 'bShowVertAxTitle', stopPropagation: true, checkable: true }, { - caption: 'Horizontal Axis Sec', + caption: me.textHorAxisSec, value: 'bShowHorAxTitleSec', stopPropagation: true, checkable: true }, { - caption: 'Vertical Axis Sec', + caption: me.textVertAxisSec, value: 'bShowVertAxisTitleSec', stopPropagation: true, checkable: true }, { - caption: 'Depth Axis Title', + caption: me.DepthAxis, value: 'bShowDepthAxisTitle', stopPropagation: true, checkable: true @@ -226,7 +232,7 @@ define([ }) }, { - caption: 'Chart Title', + caption: me.textChartTitle, value: 'chartTitle', disabled: false, menu: new Common.UI.Menu({ @@ -234,21 +240,21 @@ define([ menuAlign: 'tl-tr', items: [ { - caption: 'None', + caption: me.textNone, value: 'bShowChartTitleNone', stopPropagation: true, toggleGroup: 'chartTitle', checkable: true }, { - caption: 'No overlay', + caption: me.textNoOverlay, value: 'bShowChartTitle', stopPropagation: true, toggleGroup: 'chartTitle', checkable: true }, { - caption: 'Overlay', + caption: me.textOverlay, value: 'bOverlayTitle', stopPropagation: true, toggleGroup: 'chartTitle', @@ -258,7 +264,7 @@ define([ }) }, { - caption: 'Data Labels', + caption: me.textDataLabels, value: 'dataLabels', disabled: false, menu: new Common.UI.Menu({ @@ -266,69 +272,69 @@ define([ menuAlign: 'tl-tr', items: [ { - caption: 'None', + caption: me.textNone, value: 'bShowDataLabels', stopPropagation: true, toggleGroup: 'dataLabels', checkable: true }, { - caption: 'Center', + caption: me.textCenter, value: 'CenterData', stopPropagation: true, toggleGroup: 'dataLabels', checkable: true }, { - caption: 'Inner bottom', + caption: me.textInnerBottom, value: 'InnerBottomData', stopPropagation: true, toggleGroup: 'dataLabels', checkable: true }, { - caption: 'Inner top', + caption: me.textInnerTop, value: 'InnerTopData', stopPropagation: true, toggleGroup: 'dataLabels', checkable: true }, { - caption: 'Outer top', + caption: me.textOuterTop, value: 'OuterTopData', stopPropagation: true, toggleGroup: 'dataLabels', checkable: true }, { - caption: 'Top', + caption: me.textTop, value: 'TopData', stopPropagation: true, toggleGroup: 'dataLabels', checkable: true }, { - caption: 'Left', + caption: me.textLeft, value: 'LeftData', stopPropagation: true, toggleGroup: 'dataLabels', checkable: true }, { - caption: 'Right', + caption: me.textRight, value: 'RightData', stopPropagation: true, checkable: true }, { - caption: 'Bottom', + caption: me.textBottom, value: 'BottomData', stopPropagation: true, toggleGroup: 'dataLabels', checkable: true }, { - caption: 'Fit', + caption: me.textFit, value: 'FitWidthData', stopPropagation: true, toggleGroup: 'dataLabels', @@ -337,31 +343,8 @@ define([ ] }) }, - // { - // caption: me.textDataTable, - // value: 'dataTable', - // disabled: false, - // menu: new Common.UI.Menu({ - // cls: 'shifted-right', - // menuAlign: 'tl-tr', - // items: [ - // { - // caption: me.textNone, - // value: 'bShowDataNone' - // }, - // { - // caption: me.textShowDataTable, - // value: 'bShowDataTable' - // }, - // { - // caption: me.textShowLegendKeys, - // value: 'bShowLegendKeys' - // } - // ] - // }) - // }, { - caption: 'Error bars', + caption: me.textErrorBars, value: 'errorBars', disabled: false, menu: new Common.UI.Menu({ @@ -369,19 +352,19 @@ define([ menuAlign: 'tl-tr', items: [ { - caption: 'Standart Error', + caption: me.textStandardError, value: 'standardError', stopPropagation: true, disabled: false }, { - caption: 'Percentage', + caption: me.txtPercentage, value: 'percentage', stopPropagation: true, disabled: false }, { - caption: 'Standart Deviation', + caption: me.textStandardDeviation, value: 'standardDeviation', stopPropagation: true, disabled: false @@ -390,7 +373,7 @@ define([ }) }, { - caption: 'Gridlines', + caption: me.textGridLines, value: 'gridLines', disabled: false, menu: new Common.UI.Menu({ @@ -398,25 +381,25 @@ define([ menuAlign: 'tl-tr', items: [ { - caption: 'Horizontal Major', + caption: me.textHorizontalMajor, value: 'bShowHorMajor', stopPropagation: true, checkable: true }, { - caption: 'Vertical Major', + caption: me.textVerticalMajor, value: 'bShowVerMajor', stopPropagation: true, checkable: true }, { - caption: 'Horizontal Minor', + caption: me.textHorizontalMinor, value: 'bShowHorMinor', stopPropagation: true, checkable: true }, { - caption: 'Vertical Minor', + caption: me.textVerticalMinor, value: 'bShowVerMinor', stopPropagation: true, checkable: true @@ -425,7 +408,7 @@ define([ }) }, { - caption: 'Legend', + caption: me.textLegendPos, value: 'legend', disabled: false, menu: new Common.UI.Menu({ @@ -433,42 +416,42 @@ define([ menuAlign: 'tl-tr', items: [ { - caption: 'Top', + caption: me.textTop, value: 'TopLegend', stopPropagation: true, toggleGroup: 'legend', checkable: true }, { - caption: 'Left', + caption: me.textLeft, value: 'LeftLegend', stopPropagation: true, toggleGroup: 'legend', checkable: true }, { - caption: 'Right', + caption: me.textRight, value: 'RightLegend', stopPropagation: true, toggleGroup: 'legend', checkable: true }, { - caption: 'Bottom', + caption: me.textBottom, value: 'BottomLegend', stopPropagation: true, toggleGroup: 'legend', checkable: true }, { - caption: 'Left overlay', + caption: me.textLeftOverlay, value: 'LeftOverlay', stopPropagation: true, toggleGroup: 'legend', checkable: true }, { - caption: 'Right overlay', + caption: me.textRightOverlay, value: 'RightOverlay', stopPropagation: true, toggleGroup: 'legend', @@ -478,7 +461,7 @@ define([ }) }, { - caption: 'Trendline', + caption: me.textTrendline, value: 'trendLines', disabled: false, menu: new Common.UI.Menu({ @@ -486,27 +469,27 @@ define([ menuAlign: 'tl-tr', items: [ { - caption: 'None', + caption: me.textNone, stopPropagation: true, value: 'trendLineNone' }, { - caption: 'Linear', + caption: me.textLinear, stopPropagation: true, value: 'trendLineLinear' }, { - caption: 'Exponential', + caption: me.textExponential, stopPropagation: true, value: 'trendLineExponential' }, { - caption: 'Linear Forecast', + caption: me.textLinearForecast, stopPropagation: true, value: 'trendLineForecast' }, { - caption: 'Moving average', + caption: me.textMovingAverage, stopPropagation: true, value: 'trendLineMovingAverage' } @@ -541,7 +524,7 @@ define([ this.btnChartElements = new Common.UI.Button({ cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-freeze-panes', - caption: 'Chart Elements', + caption: me.capChartElements, lock: [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell], dataHint: '1', dataHintDirection: 'bottom', @@ -554,9 +537,8 @@ define([ this.btnChartType = new Common.UI.Button({ cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-big-sheet-view', - caption: 'Chart Type', + caption: me.capChartType, lock : [_set.lostConnect, _set.coAuth, _set.editCell], - action: 'sheet-view', dataHint : '1', dataHintDirection: 'bottom', dataHintOffset: 'small' @@ -566,9 +548,8 @@ define([ this.btnSelectData = new Common.UI.Button({ cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-big-pivot-sum', - caption: 'Select Data', + caption: me.capSelectData, lock : [_set.lostConnect, _set.coAuth, _set.editCell], - action: 'sheet-view', dataHint : '1', dataHintDirection: 'bottom', dataHintOffset: 'small' @@ -578,9 +559,8 @@ define([ this.btnSwitchRowsCols = new Common.UI.Button({ cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-big-slicer', - caption: 'Switch Row / Column', + caption: me.capRowCol, lock : [_set.lostConnect, _set.coAuth, _set.editCell], - action: 'sheet-view', dataHint : '1', dataHintDirection: 'bottom', dataHintOffset: 'small' @@ -600,7 +580,7 @@ define([ beforeOpenHandler: function(e) { var cmp = this, menu = cmp.openButton.menu, - columnCount = 7; + columnCount = 8; if (menu.cmpEl) { var itemEl = $(cmp.cmpEl.find('.dataview.inner .style').get(0)).parent(); @@ -625,6 +605,7 @@ define([ 'width': menuWidth, 'min-height': cmp.cmpEl.height() }); + console.log(menuWidth) } }, dataHint: '1', @@ -633,12 +614,22 @@ define([ }); this.lockedControls.push(this.chartStyles); + this.btn3DSettings = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-day', + caption: me.cap3DRotation, + lock : [_set.lostConnect, _set.coAuth, _set.editCell], + dataHint : '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.btn3DSettings); + this.btnAdvancedSettings = new Common.UI.Button({ cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon btn-day', - caption: 'Advanced Settings', + caption: me.capAdvancedSettings, lock : [_set.lostConnect, _set.coAuth, _set.editCell], - action: 'sheet-view', dataHint : '1', dataHintDirection: 'bottom', dataHintOffset: 'small' @@ -676,7 +667,7 @@ define([ this.lockedControls.push(this.spnHeight); this.chRatio = new Common.UI.CheckBox({ - labelText: 'Constant Proportions', + labelText: me.textLockRation, value: true, lock : [_set.lostConnect, _set.editCell], dataHint : '1', @@ -711,11 +702,11 @@ define([ this.btnChartType && this.btnChartType.render($host.find('#slot-btn-chart-type')); this.btnSelectData && this.btnSelectData.render($host.find('#slot-btn-select-data')); this.btnSwitchRowsCols && this.btnSwitchRowsCols.render($host.find('#slot-btn-switch-rowscols')); + this.btn3DSettings && this.btn3DSettings.render($host.find('#slot-btn-chart-3d-settings')); this.btnAdvancedSettings && this.btnAdvancedSettings.render($host.find('#slot-btn-chart-advanced-settings')); this.chRatio && this.chRatio.render($host.find('#slot-chk-ratio')); $host.find('#slot-lbl-width').text('Width'); $host.find('#slot-lbl-height').text('Height'); - // this.btnRemDuplicates && this.btnRemDuplicates.render($host.find('#slot-btn-remove-duplicates')); this.chartStyles.render(this.$el.find('#slot-field-chart-styles')); return this.$el; }, @@ -746,42 +737,6 @@ define([ } }, this); }, - - txtRowsCols: 'Rows & Columns', - tipRowsCols: 'Rows & Columns', - txtGroupTable_Custom: 'Custom', - txtGroupTable_Light: 'Light', - txtGroupTable_Medium: 'Medium', - txtGroupTable_Dark: 'Dark', - tipRemDuplicates: 'Removing duplicate lines from a sheet.', - tipConvertRange: 'Convert this table to a regular range of cells.', - tipInsertSlicer: 'Insert slicer', - tipInsertPivot: 'Insert Pivot Table', - tipHeaderRow: 'Show or hide the header row in a table.', - tipAltText: 'Set alternative title and description for a table.', - selectRowText: 'Select row', - selectColumnText: 'Select entire column', - selectColumnData: 'Select column data', - selectTableText: 'Select table', - insertRowAboveText: 'Insert row above', - insertRowBelowText: 'Insert row below', - insertColumnLeftText: 'Insert column left', - insertColumnRightText: 'Insert column right', - deleteRowText: 'Delete row', - deleteColumnText: 'Delete column', - deleteTableText: 'Delete table', - txtRemDuplicates: 'Remove duplicates', - txtConvertToRange: 'Convert to range', - txtSlicer: 'Slicer', - txtPivot: 'Pivot', - txtHeaderRow: 'Header row', - txtTotalRow: 'Total row', - txtFirstColumn: 'First column', - txtLastColumn: 'Last column', - txtBandedRows: 'Banded rows', - txtBandedColumns: 'Banded columns', - txtFilterButton: 'Filter button', - txtAltText: 'Alt text' } }()), SSE.Views.ChartTab || {})); }); diff --git a/apps/spreadsheeteditor/main/app/view/Charts3DDlg.js b/apps/spreadsheeteditor/main/app/view/Charts3DDlg.js new file mode 100644 index 0000000000..ee666ba83c --- /dev/null +++ b/apps/spreadsheeteditor/main/app/view/Charts3DDlg.js @@ -0,0 +1,404 @@ +/* + * (c) Copyright Ascensio System SIA 2010-2024 + * + * This program is a free software product. You can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License (AGPL) + * version 3 as published by the Free Software Foundation. In accordance with + * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect + * that Ascensio System SIA expressly excludes the warranty of non-infringement + * of any third-party rights. + * + * This program is distributed WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For + * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html + * + * You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish + * street, Riga, Latvia, EU, LV-1050. + * + * The interactive user interfaces in modified source and object code versions + * of the Program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU AGPL version 3. + * + * Pursuant to Section 7(b) of the License you must retain the original Product + * logo when distributing the program. Pursuant to Section 7(e) we decline to + * grant you any rights under trademark law for use of our trademarks. + * + * All the Product's GUI elements, including illustrations and icon sets, as + * well as technical writing content are licensed under the terms of the + * Creative Commons Attribution-ShareAlike 4.0 International. See the License + * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode + * + */ +/** + * Charts3DDlg.js + * + * Created on 12.11.2025 + * + */ +define([], function () { + 'use strict'; + var nMaxRecent = 5; + SSE.Views.Charts3DDlg = Common.UI.Window.extend(_.extend({ + initialize : function (options) { + var t = this, + _options = {}; + _.extend(_options, { + title: options.title ? options.title : this.capRotation, + cls: 'modal-dlg', + width: 250, + height: 'auto', + buttons: options.buttons ? options.buttons : [{ + value: 'ok', + caption: 'Ok' + }, 'cancel'] + }, options); + this.recentNumTypes = []; + this.handler = options.handler; + this.props = options.props; + this.numbering = options.numbering; + this.numFormat = options.numFormat; + this.mode = options.mode; + this.X = options.X; + this.Y = options.Y; + this.RightAngle = options.RightAngle; + this.Perspective = options.Perspective; + this.Depth = options.Depth; + this.Height3d = options.Height3d; + this.oView3D = options.oView3D; + this.chartProps = options.chartProps; + this.api = options.api; + this.template = options.template || [ + '
', + '' + + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
' + ].join(''); + _options.tpl = _.template(this.template)(_options); + Common.UI.Window.prototype.initialize.call(this, _options); + }, + render: function () { + Common.UI.Window.prototype.render.call(this); + var me = this; + this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); + + this.btnLeft = new Common.UI.Button({ + parentEl: $('#id-chart-btn-x-left'), + cls: 'btn-toolbar', + iconCls: 'toolbar__icon btn-rotate-270', + hint: this.textLeft, + dataHint: '1', + dataHintDirection: 'top' + }); + this.btnLeft.on('click', _.bind(function() { + this.spnX.setValue(Math.ceil((this.spnX.getNumberValue() - 10)/10)*10); + }, this)); + + this.btnRight= new Common.UI.Button({ + parentEl: $('#id-chart-btn-x-right'), + cls: 'btn-toolbar', + iconCls: 'toolbar__icon btn-rotate-90', + hint: this.textRight, + dataHint: '1', + dataHintDirection: 'top' + }); + this.btnRight.on('click', _.bind(function() { + this.spnX.setValue(Math.floor((this.spnX.getNumberValue() + 10)/10)*10); + }, this)); + + this.spnX = new Common.UI.MetricSpinner({ + el: $('#id-chart-spin-x'), + step: 10, + width: 57, + defaultUnit : "°", + value: '20 °', + maxValue: 359.9, + minValue: 0, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'big', + ariaLabel: this.textX + }); + this.spnX.on('change', _.bind(this.onXRotation, this)); + this.spnX.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);}); + + this.spnY = new Common.UI.MetricSpinner({ + el: $('#id-chart-spin-y'), + step: 10, + width: 57, + defaultUnit : "°", + value: '15 °', + maxValue: 90, + minValue: -90, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'big', + ariaLabel: this.textY + }); + this.spnY.on('change', _.bind(this.onYRotation, this)); + this.spnY.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);}); + + this.btnUp = new Common.UI.Button({ + parentEl: $('#id-chart-btn-y-up'), + cls: 'btn-toolbar', + iconCls: 'toolbar__icon btn-rotate-y-clockwise', + hint: this.textUp, + dataHint: '1', + dataHintDirection: 'top' + }); + this.btnUp.on('click', _.bind(function() { + this.spnY.setValue(Math.ceil((this.spnY.getNumberValue() - 10)/10)*10); + }, this)); + + this.btnDown= new Common.UI.Button({ + parentEl: $('#id-chart-btn-y-down'), + cls: 'btn-toolbar', + iconCls: 'toolbar__icon btn-rotate-y-counterclockwise', + hint: this.textDown, + dataHint: '1', + dataHintDirection: 'top' + }); + this.btnDown.on('click', _.bind(function() { + this.spnY.setValue(Math.floor((this.spnY.getNumberValue() + 10)/10)*10); + }, this)); + + this.spnPerspective = new Common.UI.MetricSpinner({ + el: $('#id-chart-spin-persp'), + step: 5, + width: 57, + defaultUnit : "°", + value: '0 °', + maxValue: 100, + minValue: 0.1, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'big', + ariaLabel: this.textPerspective + }); + this.spnPerspective.on('change', _.bind(this.onPerspective, this)); + this.spnPerspective.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);}); + + this.btnNarrow = new Common.UI.Button({ + parentEl: $('#id-chart-btn-narrow'), + cls: 'btn-toolbar', + iconCls: 'toolbar__icon btn-rotate-up', + hint: this.textNarrow, + dataHint: '1', + dataHintDirection: 'top' + }); + this.btnNarrow.on('click', _.bind(function() { + this.spnPerspective.setValue(Math.ceil((this.spnPerspective.getNumberValue() - 5)/5)*5); + }, this)); + + this.btnWiden= new Common.UI.Button({ + parentEl: $('#id-chart-btn-widen'), + cls: 'btn-toolbar', + iconCls: 'toolbar__icon btn-rotate-down', + hint: this.textWiden, + dataHint: '1', + dataHintDirection: 'top' + }); + this.btnWiden.on('click', _.bind(function() { + this.spnPerspective.setValue(Math.floor((this.spnPerspective.getNumberValue() + 5)/5)*5); + }, this)); + + this.chRightAngle = new Common.UI.CheckBox({ + el: $('#id-chart-checkbox-right-angle'), + labelText: this.capRightAngleAxes + }); + this.chRightAngle.on('change', _.bind(function(field, newValue, oldValue, eOpts) { + if (this.api && this.chartProps && this.oView3D) { + this.oView3D.asc_setRightAngleAxes(field.getValue()=='checked'); + } + }, this)); + + this.chAutoscale = new Common.UI.CheckBox({ + el: $('#id-chart-checkbox-autoscale'), + labelText: this.capAutoscale + }); + this.chAutoscale.on('change', _.bind(function(field, newValue, oldValue, eOpts) { + if (this.api && this.chartProps && this.oView3D){ + this.oView3D.asc_setHeight(field.getValue()=='checked' ? null : this.spn3DHeight.getNumberValue()); + } + }, this)); + + this.spn3DDepth = new Common.UI.MetricSpinner({ + el: $('#id-chart-spin-3d-depth'), + step: 10, + width: 70, + defaultUnit : "%", + value: '0 %', + maxValue: 2000, + minValue: 0, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'big', + ariaLabel: this.text3dDepth + }); + this.spn3DDepth.on('change', _.bind(this.on3DDepth, this)); + this.spn3DDepth.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);}); + + this.spn3DHeight = new Common.UI.MetricSpinner({ + el: $('#id-chart-spin-3d-height'), + step: 10, + width: 70, + defaultUnit : "%", + value: '50 %', + maxValue: 500, + minValue: 5, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'big', + ariaLabel: this.text3dHeight + }); + this.spn3DHeight.on('change', _.bind(this.on3DHeight, this)); + this.spn3DHeight.on('inputleave', function(){ Common.NotificationCenter.trigger('edit:complete', me);}); + + this.linkDefRotation = $('#id-chart-def-rotate-link'); + this.linkDefRotation.on('click', _.bind(this.onDefRotation, this)); + + this.spnX.setValue((me.X!==null && me.X !== undefined) ? me.X : '', true); + this.spnY.setValue((me.Y!==null && me.Y !== undefined) ? me.Y : '', true); + this.chRightAngle.setValue((me.RightAngle !== null && me.RightAngle !== undefined) ? me.RightAngle : 'indeterminate', true); + this.spnPerspective.setMinValue((me.Perspective!==null && me.Perspective !== undefined) ? 0.1 : 0); + this.spnPerspective.setValue((me.Perspective!==null && me.Perspective !== undefined) ? me.Perspective : 0, true); + this.spnPerspective.setDisabled(!!me.RightAngle); + this.btnNarrow.setDisabled(!!me.RightAngle); + this.btnWiden.setDisabled(!!me.RightAngle); + this.spn3DDepth.setValue((me.Depth!==null && me.Depth !== undefined) ? me.Depth : '', true); + this.chAutoscale.setValue(me.Height3d===null, true); + (me.Height3d!==null) && this.spn3DHeight.setValue(me.Height3d, true); + this.spn3DHeight.setDisabled(me.Height3d===null); + + this.btnOk = _.find(this.getFooterButtons(), function (item) { + return (item.$el && item.$el.find('.primary').addBack().filter('.primary').length>0); + }) || new Common.UI.Button({ el: this.$window.find('.primary') }); + this.afterRender(); + }, + + onXRotation: function(field, newValue, oldValue, eOpts){ + if (this.api && this.chartProps && this.oView3D) { + this.oView3D.asc_setRotX(field.getNumberValue()); + } + }, + + onYRotation: function(field, newValue, oldValue, eOpts){ + if (this.api && this.chartProps && this.oView3D) { + this.oView3D.asc_setRotY(field.getNumberValue()); + } + }, + + onPerspective: function(field, newValue, oldValue, eOpts){ + if (this.api && this.chartProps && this.oView3D) { + this.oView3D.asc_setPerspective(field.getNumberValue()); + } + }, + + on3DDepth: function(field, newValue, oldValue, eOpts){ + if (this.api && this.chartProps && this.oView3D) { + this.oView3D.asc_setDepth(field.getNumberValue()); + } + }, + + on3DHeight: function(field, newValue, oldValue, eOpts){ + if (this.api && this.chartProps && this.oView3D) { + this.oView3D.asc_setHeight(field.getNumberValue()); + } + }, + + onDefRotation: function() { + var me = this; + if (this.api && this.chartProps && this.oView3D) { + this.oView3D.asc_setRotX(20); + this.oView3D.asc_setRotY(15); + me.spnX.setValue(20); + me.spnY.setValue(15); + } + }, + + getFocusedComponents: function() { + return [this.btnLeft, this.btnRight].concat(this.getFooterButtons()); + }, + getDefaultFocusableComponent: function () { + return this.spnX; + }, + afterRender: function() { + this._setDefaults(this.props); + }, + onPrimary: function(event) { + this._handleInput('ok'); + return false; + }, + onBtnClick: function(event) { + this._handleInput(event.currentTarget.attributes['result'].value); + }, + _handleInput: function(state) { + var me = this; + if (state === 'ok' && this.btnOk.isDisabled()) + return; + if (this.handler) { + this.handler.call(this, state, me.oView3D, me.chartProps); + } + this.close(); + }, + _setDefaults: function (props) { + if (props) { + } + }, + getSettings: function() { + }, + SetDisabled: function(disabled) { + this.btnOk.setDisabled(disabled); + }, + }, SSE.Views.Charts3DDlg || {})); +}); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/SparklineTab.js b/apps/spreadsheeteditor/main/app/view/SparklineTab.js index 367873c306..950e73fb78 100644 --- a/apps/spreadsheeteditor/main/app/view/SparklineTab.js +++ b/apps/spreadsheeteditor/main/app/view/SparklineTab.js @@ -40,26 +40,126 @@ define([ 'common/main/lib/util/utils', 'common/main/lib/component/Button', 'common/main/lib/component/BaseView', - 'common/main/lib/component/Layout' + 'common/main/lib/component/Layout', + 'common/main/lib/component/Label', + 'common/main/lib/component/ThemeColorPalette', ], function () { 'use strict'; SSE.Views.SparklineTab = Common.UI.BaseView.extend(_.extend((function(){ var template = '
' + + '
' + + '' + + '' + + '' + + '
' + + '
' + + '
' + + '
' + + '' + + '
' + + '
' + + '' + + '
' + + '
' + + '
' + + '
' + + '' + + '
' + + '
' + + '' + + '
' + + '
' + + '
' + + '
' + + '' + + '
' + + '
' + + '' + + '
' + + '
' + + '
' + + '
' + + '' + + '
' + + '
' + + '
' + + '
' + + '' + + '
' + + '
' + + ' ' + + '' + + '
' + + '
' + + '
' + + '
' + + '
' + + '' + + '
' + + '
' + + '' + + '
' + + '
' + '
'; function setEvents() { var me = this; - - // me.btnChartElements.on('click', function (btn, e) { - // me.fireEvent('charttab:updatemenu', [me.menuChartElement.menu]); - // }); + this.chHighPoint.on('change', function (type, field, newValue, oldValue, eOpts) { + me.fireEvent('sparkline:checkbox', [0, field, 0]); + }); + this.chLowPoint.on('change', function (type, field, newValue, oldValue, eOpts) { + me.fireEvent('sparkline:checkbox', [1, field, 1]); + }); + this.chNegativePoint.on('change', function (type, field, newValue, oldValue, eOpts) { + me.fireEvent('sparkline:checkbox', [2, field, 2]); + }); + this.chFirstPoint.on('change', function (type, field, newValue, oldValue, eOpts) { + me.fireEvent('sparkline:checkbox', [3, field, 3]); + }); + this.chLastPoint.on('change', function (type, field, newValue, oldValue, eOpts) { + me.fireEvent('sparkline:checkbox', [4, field, 4]); + }); + this.chMarkers.on('change', function (type, field, newValue, oldValue, eOpts) { + me.fireEvent('sparkline:checkbox', [5, field, 5]); + }); + this.btnLineType.on('click', function () { + me.fireEvent('sparkline:type', [0]); + }); + this.btnColumnType.on('click', function () { + me.fireEvent('sparkline:type', [1]); + }); + this.btnWinLossType.on('click', function () { + me.fireEvent('sparkline:type', [2]); + }); + this.btnSparklineColor.menu.on('item:click', function (menu, item) { + me.fireEvent('sparkline:addnewcolor', [menu, item]) + }); + this.btnClear.menu.on('item:click', function (menu, item, e) { + me.fireEvent('sparkline:clear', [menu, item, e]) + }); + this.btnAdvancedSettings.on('click', function () { + me.fireEvent('sparkline:advanced'); + }); + this.cmbBorderSize.on('selected', function (combo, record) { + me.fireEvent('sparkline:bordersizeselect', [combo, record]) + }); + this.cmbBorderSize.on('changed:before', function (combo, record) { + me.fireEvent('sparkline:bordersizechanged', [combo, record, true]) + }); + this.cmbBorderSize.on('changed:after', function (combo, record) { + me.fireEvent('sparkline:bordersizechanged', [combo, record, false]) + }); + this.cmbSparkStyle.on('click', function (combo, record) { + me.fireEvent('sparkline:styleselect', [combo, record]) + }); } return { initialize: function (options) { var controller = SSE.getController('SparklineTab'); this._state = controller._state; + this.defColor = {r: 255, g: 239, b: 191, Auto: false}; Common.UI.BaseView.prototype.initialize.call(this); this.lockedControls = []; @@ -67,16 +167,283 @@ define([ var me = this, _set = Common.enumLock; - // this.chRatio = new Common.UI.CheckBox({ - // labelText: 'Constant Proportions', - // value: true, - // lock : [_set.lostConnect, _set.editCell], - // dataHint : '1', - // dataHintDirection: 'left', - // dataHintOffset: 'small' - // }); - // this.lockedControls.push(this.chRatio); + this.btnLineType = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-big-sheet-view', + caption: me.capLine, + lock : [_set.lostConnect, _set.coAuth, _set.editCell], + enableToggle: true, + action: 'sheet-view', + dataHint : '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.btnLineType); + this.btnColumnType = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-big-pivot-sum', + caption: me.capColumn, + lock : [_set.lostConnect, _set.coAuth, _set.editCell], + enableToggle: true, + action: 'sheet-view', + dataHint : '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.btnColumnType); + + this.btnWinLossType = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-big-slicer', + caption: me.capWinLoss, + lock : [_set.lostConnect, _set.coAuth, _set.editCell], + enableToggle: true, + action: 'sheet-view', + dataHint : '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.btnWinLossType); + + this.chHighPoint = new Common.UI.CheckBox({ + labelText: me.textHighPoint, + lock : [_set.lostConnect, _set.editCell], + dataHint : '1', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.chHighPoint); + + this.chLowPoint = new Common.UI.CheckBox({ + labelText: me.textLowPoint, + lock : [_set.lostConnect, _set.editCell], + dataHint : '1', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.chLowPoint); + + this.chFirstPoint = new Common.UI.CheckBox({ + labelText: me.textFirstPoint, + lock : [_set.lostConnect, _set.editCell], + dataHint : '1', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.chFirstPoint); + + this.chLastPoint = new Common.UI.CheckBox({ + labelText: me.textLastPoint, + lock : [_set.lostConnect, _set.editCell], + dataHint : '1', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.chLastPoint); + + this.chNegativePoint = new Common.UI.CheckBox({ + labelText: me.textNegativePoint, + lock : [_set.lostConnect, _set.editCell], + dataHint : '1', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.chNegativePoint); + + this.chMarkers = new Common.UI.CheckBox({ + labelText: me.textMarkers, + lock : [_set.lostConnect, _set.editCell], + dataHint : '1', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.chMarkers); + + this.btnMarkerColor = new Common.UI.Button({ + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-day', + caption: me.capMarkerColor, + lock : [_set.lostConnect, _set.coAuth, _set.editCell], + menu: true, + dataHint : '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.btnMarkerColor); + + this.cmbSparkStyle = new Common.UI.ComboDataView({ + itemWidth: 50, + itemHeight: 50, + menuMaxHeight: 300, + enableKeyEvents: true, + cls: 'combo-chart-template', + style: 'min-width: 103px; max-width: 517px;', + delayRenderTips: true, + autoWidth: true, + fillOnChangeVisibility: true + }); + this.cmbSparkStyle.openButton.menu.on('show:after', function () { + me.cmbSparkStyle.menuPicker.scroller.update({alwaysVisibleY: true}); + }); + this.lockedControls.push(this.cmbSparkStyle); + + this.btnSparklineColor = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'toolbar__icon btn-remove-trace-arrows', + lock: [_set.editCell], + caption: this.capSparklineColor, + menu: new Common.UI.Menu({ + cls: 'color-menu', + menuAlign: 'tl-tr', + items: [ + { template: _.template('
'), stopPropagation: true }, + { caption: '--'}, + { + caption: this.textMoreColors, + value: 1 + }, + ] + }), + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: '0, -8' + }); + this.lockedControls.push(this.btnRemArrows); + + this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({ + style : 'width: 90px;', + allowNoBorders: false + }) + this.BorderSize = this.cmbBorderSize.store.at(1).get('value'); + this.cmbBorderSize.setValue(this.BorderSize); + this.lockedControls.push(this.cmbBorderSize); + + this.lblLineWeight = new Common.UI.Label({ + caption: me.lblLineWeight, + lock: [_set.noParagraphSelected, _set.paragraphLock, _set.headerLock, _set.richEditLock, _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart, _set.docLockViewPara, _set.docLockForms, _set.docLockCommentsPara, _set.fixedForm, _set.viewMode] + }); + + this.btnAdvancedSettings = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'toolbar__icon btn-remove-trace-arrows', + lock: [_set.editCell], + caption: this.capAdvancedSettings, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: '0, -8' + }); + this.lockedControls.push(this.btnAdvancedSettings); + + this.btnClear = new Common.UI.Button({ + cls: 'btn-toolbar', + iconCls: 'toolbar__icon btn-remove-trace-arrows', + lock: [_set.editCell], + caption: this.capClear, + menu : new Common.UI.Menu({ + menuAlign: 'tl-tr', + items : [ + { caption: me.txtClearSparklines, value: Asc.c_oAscCleanOptions.Sparklines }, + { caption: me.txtClearSparklineGroups, value: Asc.c_oAscCleanOptions.SparklineGroups } + ] + }), + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: '0, -8' + }); + this.lockedControls.push(this.btnClear); + + var colorMenu = new Common.UI.Menu({ + cls: 'menu-marker-colors', + items: [ + new Common.UI.MenuItem({ + caption: me.textHighPoint, + color: '#' + Common.Utils.ThemeColor.getHexColor(me.defColor.r, me.defColor.g, me.defColor.b), + checkable: true, + menu: true, + value: 'high', + toggleGroup: 'formtab-view-role', + template: _.template([ + '', + '', + '<%= Common.Utils.String.htmlEncode(caption) %>', + '' + ].join('')) + }), + new Common.UI.MenuItem({ + caption: me.textLowPoint, + color: '#' + Common.Utils.ThemeColor.getHexColor(me.defColor.r, me.defColor.g, me.defColor.b), + checkable: true, + menu: true, + value: 'low', + toggleGroup: 'formtab-view-role', + template: _.template([ + '', + '', + '<%= Common.Utils.String.htmlEncode(caption) %>', + '' + ].join('')) + }), + new Common.UI.MenuItem({ + caption: me.textFirstPoint, + color: '#' + Common.Utils.ThemeColor.getHexColor(me.defColor.r, me.defColor.g, me.defColor.b), + checkable: true, + menu: true, + value: 'first', + toggleGroup: 'formtab-view-role', + template: _.template([ + '', + '', + '<%= Common.Utils.String.htmlEncode(caption) %>', + '' + ].join('')) + }), + new Common.UI.MenuItem({ + caption: me.textLastPoint, + color: '#' + Common.Utils.ThemeColor.getHexColor(me.defColor.r, me.defColor.g, me.defColor.b), + checkable: true, + menu: true, + value: 'last', + toggleGroup: 'formtab-view-role', + template: _.template([ + '', + '', + '<%= Common.Utils.String.htmlEncode(caption) %>', + '' + ].join('')) + }), + new Common.UI.MenuItem({ + caption: me.textNegativePoint, + color: '#' + Common.Utils.ThemeColor.getHexColor(me.defColor.r, me.defColor.g, me.defColor.b), + checkable: true, + menu: true, + value: 'negative', + toggleGroup: 'formtab-view-role', + template: _.template([ + '', + '', + '<%= Common.Utils.String.htmlEncode(caption) %>', + '' + ].join('')) + }), + new Common.UI.MenuItem({ + caption: me.textMarkers, + color: '#' + Common.Utils.ThemeColor.getHexColor(me.defColor.r, me.defColor.g, me.defColor.b), + checkable: true, + menu: true, + value: 'markers', + toggleGroup: 'formtab-view-role', + template: _.template([ + '', + '', + '<%= Common.Utils.String.htmlEncode(caption) %>', + '' + ].join('')) + }), + ] + }) + + this.btnMarkerColor.setMenu(colorMenu) Common.UI.LayoutManager.addControls(this.lockedControls); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); }, @@ -95,10 +462,25 @@ define([ getPanel: function () { this.$el = $(_.template(template)( {} )); var $host = this.$el; - - // this.btnAdvancedSettings && this.btnAdvancedSettings.render($host.find('#slot-btn-chart-advanced-settings')); - // $host.find('#slot-lbl-height').text('Height'); - // this.chartStyles.render(this.$el.find('#slot-field-chart-styles')); + var _injectComponent = function (id, cmp) { + Common.Utils.injectComponent($host.findById(id), cmp); + }; + _injectComponent('#slot-spin-line-weight', this.cmbBorderSize); + _injectComponent('#id-spark-combo-style', this.cmbSparkStyle); + this.lblLineWeight && this.lblLineWeight.render($host.find('#slot-lbl-line-weight')); + this.btnLineType && this.btnLineType.render($host.find('#slot-btn-sparkline-line')); + this.btnColumnType && this.btnColumnType.render($host.find('#slot-btn-sparkline-column')); + this.btnWinLossType && this.btnWinLossType.render($host.find('#slot-btn-sparkline-winloss')); + this.chHighPoint && this.chHighPoint.render($host.find('#slot-chk-high')); + this.chLowPoint && this.chLowPoint.render($host.find('#slot-chk-low')); + this.chFirstPoint && this.chFirstPoint.render($host.find('#slot-chk-first')); + this.chLastPoint && this.chLastPoint.render($host.find('#slot-chk-last')); + this.chNegativePoint && this.chNegativePoint.render($host.find('#slot-chk-negative')); + this.chMarkers && this.chMarkers.render($host.find('#slot-chk-markers')); + this.btnMarkerColor && this.btnMarkerColor.render($host.find('#slot-btn-sparkline-marker-color')); + this.btnSparklineColor && this.btnSparklineColor.render($host.find('#slot-btn-sparkline-color')); + this.btnAdvancedSettings && this.btnAdvancedSettings.render($host.find('#slot-btn-sparkline-advanced')); + this.btnClear && this.btnClear.render($host.find('#slot-btn-sparkline-clear')); return this.$el; }, @@ -107,7 +489,35 @@ define([ (new Promise(function (accept, reject) { accept(); })).then(function(){ - // me.btnAdvancedSettings.updateHint('Advanced settings') + me.btnMarkerColor.menu.items.forEach(function (item, index) { + var subMenu = new Common.UI.Menu({ + cls: 'color-menu', + menuAlign: 'tl-tr', + items: [ + { template: _.template(`
`), stopPropagation: true }, + { caption: '--'}, + { + caption: me.textMoreColors, + value: 1 + }, + ] + }); + + subMenu.on('item:click', function (menu, color) { + me.fireEvent('sparkline:addnewcolor', [menu, color]) + }) + item.setMenu(subMenu); + + var colorsMenu = new Common.UI.ThemeColorPalette({ + el: $(`#sparkline-markers-menu-picker${index}`), + outerMenu: {menu: item.menu, index: 0} + }); + item.menu.setInnerMenu([{menu: colorsMenu, index: 0}]); + colorsMenu.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors()); + colorsMenu.on('select', function (item, color) { + me.fireEvent('sparkline:markerscolor', [item, color, index]) + }); + }); setEvents.call(me); }); }, @@ -128,42 +538,6 @@ define([ } }, this); }, - - txtRowsCols: 'Rows & Columns', - tipRowsCols: 'Rows & Columns', - txtGroupTable_Custom: 'Custom', - txtGroupTable_Light: 'Light', - txtGroupTable_Medium: 'Medium', - txtGroupTable_Dark: 'Dark', - tipRemDuplicates: 'Removing duplicate lines from a sheet.', - tipConvertRange: 'Convert this table to a regular range of cells.', - tipInsertSlicer: 'Insert slicer', - tipInsertPivot: 'Insert Pivot Table', - tipHeaderRow: 'Show or hide the header row in a table.', - tipAltText: 'Set alternative title and description for a table.', - selectRowText: 'Select row', - selectColumnText: 'Select entire column', - selectColumnData: 'Select column data', - selectTableText: 'Select table', - insertRowAboveText: 'Insert row above', - insertRowBelowText: 'Insert row below', - insertColumnLeftText: 'Insert column left', - insertColumnRightText: 'Insert column right', - deleteRowText: 'Delete row', - deleteColumnText: 'Delete column', - deleteTableText: 'Delete table', - txtRemDuplicates: 'Remove duplicates', - txtConvertToRange: 'Convert to range', - txtSlicer: 'Slicer', - txtPivot: 'Pivot', - txtHeaderRow: 'Header row', - txtTotalRow: 'Total row', - txtFirstColumn: 'First column', - txtLastColumn: 'Last column', - txtBandedRows: 'Banded rows', - txtBandedColumns: 'Banded columns', - txtFilterButton: 'Filter button', - txtAltText: 'Alt text' } }()), SSE.Views.SparklineTab || {})); }); diff --git a/apps/spreadsheeteditor/main/app_dev.js b/apps/spreadsheeteditor/main/app_dev.js index 777cd17e00..163961d1d3 100644 --- a/apps/spreadsheeteditor/main/app_dev.js +++ b/apps/spreadsheeteditor/main/app_dev.js @@ -282,6 +282,7 @@ require([ 'spreadsheeteditor/main/app/view/ShapeSettingsAdvanced', 'spreadsheeteditor/main/app/view/ProtectDialog', 'spreadsheeteditor/main/app/view/ProtectedRangesEditDlg', + 'spreadsheeteditor/main/app/view/Charts3DDlg', 'spreadsheeteditor/main/app/view/CreatePivotDialog', 'spreadsheeteditor/main/app/view/SortOptionsDialog', 'spreadsheeteditor/main/app/view/SetValueDialog', diff --git a/apps/spreadsheeteditor/main/app_pack.js b/apps/spreadsheeteditor/main/app_pack.js index e6ea39a5d2..055bc71e78 100644 --- a/apps/spreadsheeteditor/main/app_pack.js +++ b/apps/spreadsheeteditor/main/app_pack.js @@ -78,6 +78,7 @@ require([ 'spreadsheeteditor/main/app/view/ShapeSettingsAdvanced', 'spreadsheeteditor/main/app/view/ProtectDialog', 'spreadsheeteditor/main/app/view/ProtectedRangesEditDlg', + 'spreadsheeteditor/main/app/view/Charts3DDlg', 'spreadsheeteditor/main/app/view/CreatePivotDialog', 'spreadsheeteditor/main/app/view/SortOptionsDialog', 'spreadsheeteditor/main/app/view/SetValueDialog', diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 937a04d1ef..fff7f705ac 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -2403,6 +2403,7 @@ "SSE.Controllers.Viewport.textHideFBar": "Hide Formula Bar", "SSE.Controllers.Viewport.textHideGridlines": "Hide Gridlines", "SSE.Controllers.Viewport.textHideHeadings": "Hide Headings", + "SSE.Controllers.SparklineTab.txtPt": "pt", "SSE.Views.AdvancedSeparatorDialog.strDecimalSeparator": "Decimal separator", "SSE.Views.AdvancedSeparatorDialog.strThousandsSeparator": "Thousands separator", "SSE.Views.AdvancedSeparatorDialog.textLabel": "Settings used to recognize numeric data", @@ -3552,6 +3553,56 @@ "SSE.Views.FormulaTab.txtRemPrec": "Remove Precedents Arrows", "SSE.Views.FormulaTab.txtShowFormulas": "Show Formulas", "SSE.Views.FormulaTab.txtWatch": "Watch Window", + "SSE.Views.ChartTab.textAxes": "Axes", + "SSE.Views.ChartTab.textHorAxis": "Horizontal axis", + "SSE.Views.ChartTab.textVertAxis": "Vertical axis", + "SSE.Views.ChartTab.textHorAxisSec": "Secondary horizontal axis", + "SSE.Views.ChartTab.textVertAxisSec": "Secondary vertical axis", + "SSE.Views.ChartTab.DepthAxis": "Z axis", + "SSE.Views.ChartTab.textAxisTitles": "Axis Titles", + "SSE.Views.ChartTab.textChartTitle": "Chart title", + "SSE.Views.ChartTab.textNone": "None", + "SSE.Views.ChartTab.textNoOverlay": "No overlay", + "SSE.Views.ChartTab.textOverlay": "Overlay", + "SSE.Views.ChartTab.textDataLabels": "Data labels", + "SSE.Views.ChartTab.textCenter": "Center", + "SSE.Views.ChartTab.textInnerBottom": "Inner bottom", + "SSE.Views.ChartTab.textInnerTop": "Inner top", + "SSE.Views.ChartTab.textOuterTop": "Outer top", + "SSE.Views.ChartTab.textTop": "Top", + "SSE.Views.ChartTab.textLeft": "Left", + "SSE.Views.ChartTab.textRight": "Right", + "SSE.Views.ChartTab.textBottom": "Bottom", + "SSE.Views.ChartTab.textFit": "Fit to width", + "SSE.Views.ChartTab.textErrorBars": "Error Bars", + "SSE.Views.ChartTab.textStandardError": "Standard Error", + "SSE.Views.ChartTab.txtPercentage": "Percentage", + "SSE.Views.ChartTab.textStandardDeviation": "Standard Deviation", + "SSE.Views.ChartTab.textGridLines": "Gridlines", + "SSE.Views.ChartTab.textHorizontalMajor": "Horizontal Major", + "SSE.Views.ChartTab.textVerticalMajor": "Vertical Major", + "SSE.Views.ChartTab.textHorizontalMinor": "Horizontal Minor", + "SSE.Views.ChartTab.textVerticalMinor": "Vertical Minor", + "SSE.Views.ChartTab.textLegendPos": "Legend", + "SSE.Views.ChartTab.textLeftOverlay": "Left overlay", + "SSE.Views.ChartTab.textRightOverlay": "Right overlay", + "SSE.Views.ChartTab.textTrendlineOptions": "Trendline options", + "SSE.Views.ChartTab.textLinear": "Linear", + "SSE.Views.ChartTab.textLinearForecast": "Linear Forecast", + "SSE.Views.ChartTab.textLinearTrend": "Linear trend", + "SSE.Views.ChartTab.textExponential": "Exponential", + "SSE.Views.ChartTab.textMovingAverage": "Moving Average (2)", + "SSE.Views.ChartTab.textUpDownBars": " Up/Down Bars", + "SSE.Views.ChartTab.textShowUpDown": "Show Up/Down Bars", + "SSE.Views.ChartTab.capChartElements": "Chart Elements", + "SSE.Views.ChartTab.capChartType": "Chart Type", + "SSE.Views.ChartTab.capSelectData": "Select Data", + "SSE.Views.ChartTab.capRowCol": "Switch Row / Column", + "SSE.Views.ChartTab.cap3DRotation": "3D rotation", + "SSE.Views.ChartTab.capAdvancedSettings": "Advanced Settings", + "SSE.Views.ChartTab.textWidth": "Width", + "SSE.Views.ChartTab.textHeight": "Height", + "SSE.Views.ChartTab.textLockRation": "Lock aspect ration", "SSE.Views.FormulaWizard.textAny": "any", "SSE.Views.FormulaWizard.textArgument": "Argument", "SSE.Views.FormulaWizard.textFunction": "Function", @@ -4130,6 +4181,15 @@ "SSE.Views.ProtectDialog.txtWarning": "Warning: If you lose or forget the password, it cannot be recovered. Please keep it in a safe place.", "SSE.Views.ProtectDialog.txtWBDescription": "To prevent other users from viewing hidden sheets, adding, moving, deleting, or hiding sheets and renaming sheets, you can protect the structure of your workbook with a password.", "SSE.Views.ProtectDialog.txtWBTitle": "Protect workbook structure", + "SSE.Views.Charts3DDlg.txtXRotation": "X-rotation", + "SSE.Views.Charts3DDlg.txtYRotation": "Y-rotation", + "SSE.Views.Charts3DDlg.txtPerspective": "Perspective", + "SSE.Views.Charts3DDlg.txtDepth": "Depth (% of base)", + "SSE.Views.Charts3DDlg.txtHeight": "Height (% of base)", + "SSE.Views.Charts3DDlg.txtDefRotation": "Default Rotation", + "SSE.Views.Charts3DDlg.capRotation": "3D Rotation", + "SSE.Views.Charts3DDlg.capRightAngleAxes": "Right angle axes", + "SSE.Views.Charts3DDlg.capAutoscale": "Autoscale", "SSE.Views.ProtectedRangesEditDlg.textAnonymous": "Anonymous", "SSE.Views.ProtectedRangesEditDlg.textAnyone": "Anyone", "SSE.Views.ProtectedRangesEditDlg.textCanEdit": "Edit", @@ -4848,6 +4908,8 @@ "SSE.Views.Toolbar.textTabLayout": "Layout", "SSE.Views.Toolbar.textTabProtect": "Protection", "SSE.Views.Toolbar.textTabTableDesign": "Table Design", + "SSE.Views.Toolbar.textTabChart": "Chart design", + "SSE.Views.Toolbar.textTabSparkline": "Sparkline", "SSE.Views.Toolbar.textTabView": "View", "SSE.Views.Toolbar.textThisPivot": "From this pivot", "SSE.Views.Toolbar.textThisSheet": "From this sheet", @@ -5097,6 +5159,24 @@ "SSE.Views.ViewTab.tipViewPageBreak": "See where the page breaks will appear when your document is printed", "SSE.Views.ViewTab.txtViewNormal": "Normal", "SSE.Views.ViewTab.txtViewPageBreak": "Page Break Preview", + "SSE.Views.SparklineTab.capLine": "Line", + "SSE.Views.SparklineTab.capColumn": "Column", + "SSE.Views.SparklineTab.capWinLoss": "Win/Loss", + "SSE.Views.SparklineTab.capMarkerColor": "Marker Color", + "SSE.Views.SparklineTab.capSparklineColor": "Sparkline Color", + "SSE.Views.SparklineTab.capAdvancedSettings": "Advanced settings", + "SSE.Views.SparklineTab.capClear": "Clear", + "SSE.Views.SparklineTab.textHighPoint": "High point", + "SSE.Views.SparklineTab.textLowPoint": "Low point", + "SSE.Views.SparklineTab.textFirstPoint": "First point", + "SSE.Views.SparklineTab.textLastPoint": "Last point", + "SSE.Views.SparklineTab.textNegativePoint": "Negative point", + "SSE.Views.SparklineTab.textMarkers": "Markers", + "SSE.Views.SparklineTab.lblLineWeight": "Line weight", + "SSE.Views.SparklineTab.textMoreColors": "More colors", + "SSE.Views.SparklineTab.txtClearSparklineGroups": "Clear selected sparkline groups", + "SSE.Views.SparklineTab.txtClearSparklines": "Clear selected sparklines", + "SSE.Views.SparklineTab.textBorderSizeErr": "The entered value is incorrect.
Please enter a value between 0 pt and 1584 pt.", "SSE.Views.WatchDialog.closeButtonText": "Close", "SSE.Views.WatchDialog.textAdd": "Add watch", "SSE.Views.WatchDialog.textBook": "Book", diff --git a/apps/spreadsheeteditor/main/resources/less/toolbar.less b/apps/spreadsheeteditor/main/resources/less/toolbar.less index b1b468cbaf..78c79c03ed 100644 --- a/apps/spreadsheeteditor/main/resources/less/toolbar.less +++ b/apps/spreadsheeteditor/main/resources/less/toolbar.less @@ -10,6 +10,32 @@ } } + .dropdown-menu.menu-marker-colors { + li > a { + display: flex; + align-items: center; + } + + .dropdown-submenu > a:after { + margin-left: auto; + margin-bottom: 3px; + } + + span.color { + flex-shrink: 0; + display: inline-block; + vertical-align: text-top; + width: 12px; + height: 12px; + margin: 0 8px 0 2px; + border: @scaled-one-px-value-ie solid @border-color-shading-ie; + border: @scaled-one-px-value solid @border-color-shading; + .rtl & { + margin: 0 2px 0 8px; + } + } + } + .simple-bar { display: flex; align-items: center;