diff --git a/apps/common/main/resources/less/buttons.less b/apps/common/main/resources/less/buttons.less
index 8f5bb6b949..0f1d7f6fe9 100644
--- a/apps/common/main/resources/less/buttons.less
+++ b/apps/common/main/resources/less/buttons.less
@@ -950,6 +950,38 @@
}
}
+ &.svg-chartlist {
+ width: 40px;
+ height: 40px;
+ .icon {
+ width: 40px;
+ height: 40px;
+ }
+
+ &:hover:not(.disabled) {
+ svg.icon {
+ opacity: 1;
+ }
+ }
+
+ &:active,
+ &.active {
+ &:not(.disabled) {
+ svg.icon {
+ fill: @icon-normal-pressed-ie;
+ fill: @icon-normal-pressed;
+ opacity: 1;
+ }
+ }
+ }
+
+ svg.icon {
+ fill: @icon-normal-ie;
+ fill: @icon-normal;
+ opacity: 1;
+ }
+ }
+
box-shadow: inset 0 0 0 @scaled-one-px-value-ie @border-regular-control-ie;
box-shadow: inset 0 0 0 @scaled-one-px-value @border-regular-control;
.border-radius(@border-radius-small);
diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js
index 700796584a..a233256dc4 100644
--- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js
+++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js
@@ -63,7 +63,8 @@ define([
'spreadsheeteditor/main/app/view/FormatRulesManagerDlg',
'spreadsheeteditor/main/app/view/SlicerAddDialog',
'spreadsheeteditor/main/app/view/AdvancedSeparatorDialog',
- 'spreadsheeteditor/main/app/view/CreateSparklineDialog'
+ 'spreadsheeteditor/main/app/view/CreateSparklineDialog',
+ 'spreadsheeteditor/main/app/view/ChartRecommendedDialog'
], function () { 'use strict';
SSE.Controllers.Toolbar = Backbone.Controller.extend(_.extend({
@@ -487,7 +488,8 @@ define([
if (toolbar.btnCondFormat.rendered) {
toolbar.btnCondFormat.menu.on('show:before', _.bind(this.onShowBeforeCondFormat, this, this.toolbar, 'toolbar'));
}
- Common.Gateway.on('insertimage', _.bind(this.insertImage, this));
+ toolbar.btnInsertChartRecommend.on('click', _.bind(this.onChartRecommendedClick, this));
+ Common.Gateway.on('insertimage', _.bind(this.insertImage, this));
this.onSetupCopyStyleButton();
}
@@ -4343,7 +4345,7 @@ define([
});
toolbar.lockToolbar(Common.enumLock.coAuthText, is_objLocked);
- toolbar.lockToolbar(Common.enumLock.coAuthText, is_objLocked && (seltype==Asc.c_oAscSelectionType.RangeChart || seltype==Asc.c_oAscSelectionType.RangeChartText), { array: [toolbar.btnInsertChart] } );
+ toolbar.lockToolbar(Common.enumLock.coAuthText, is_objLocked && (seltype==Asc.c_oAscSelectionType.RangeChart || seltype==Asc.c_oAscSelectionType.RangeChartText), { array: [toolbar.btnInsertChart, toolbar.btnInsertChartRecommend] } );
toolbar.lockToolbar(Common.enumLock.inSmartartInternal, is_smartart_internal);
}
@@ -5151,6 +5153,62 @@ define([
this.toolbar._isEyedropperStart = false;
},
+ onChartRecommendedClick: function() {
+ var me = this,
+ info = me.api.asc_getCellInfo(),
+ seltype = info.asc_getSelectionType(),
+ ischartedit = ( seltype == Asc.c_oAscSelectionType.RangeChart || seltype == Asc.c_oAscSelectionType.RangeChartText),
+ props = me.api.asc_getChartObject(true); // don't lock chart object
+ (new SSE.Views.ChartRecommendedDialog({
+ api: me.api,
+ props: props,
+ handler: function(result, value) {
+ if (result == 'ok') {
+ if (me.api) {
+ var type = value.type;
+ if (type!==null) {
+ if (ischartedit)
+ props.changeType(type);
+ else {
+ props.putType(type);
+ var range = props.getRange(),
+ isvalid = (!_.isEmpty(range)) ? me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, range, true, props.getInRows(), props.getType()) : Asc.c_oAscError.ID.No;
+ if (isvalid == Asc.c_oAscError.ID.No) {
+ me.api.asc_addChartDrawingObject(props);
+ } else {
+ var msg = me.txtInvalidRange;
+ switch (isvalid) {
+ case Asc.c_oAscError.ID.StockChartError:
+ msg = me.errorStockChart;
+ break;
+ case Asc.c_oAscError.ID.MaxDataSeriesError:
+ msg = me.errorMaxRows;
+ break;
+ case Asc.c_oAscError.ID.ComboSeriesError:
+ msg = me.errorComboSeries;
+ break;
+ case Asc.c_oAscError.ID.MaxDataPointsError:
+ msg = me.errorMaxPoints;
+ break;
+ }
+ Common.UI.warning({
+ msg: msg,
+ callback: function () {
+ _.defer(function (btn) {
+ Common.NotificationCenter.trigger('edit:complete', me.toolbar);
+ })
+ }
+ });
+ }
+ }
+ }
+ }
+ }
+ Common.NotificationCenter.trigger('edit:complete', me.toolbar);
+ }
+ })).show();
+ },
+
textEmptyImgUrl : 'You need to specify image URL.',
warnMergeLostData : 'Operation can destroy data in the selected cells.
Continue?',
textWarning : 'Warning',
diff --git a/apps/spreadsheeteditor/main/app/template/Toolbar.template b/apps/spreadsheeteditor/main/app/template/Toolbar.template
index 1064057116..05b1006539 100644
--- a/apps/spreadsheeteditor/main/app/template/Toolbar.template
+++ b/apps/spreadsheeteditor/main/app/template/Toolbar.template
@@ -139,9 +139,13 @@
+
+
+
| ', + '', + ' | ', + '
| ', + '', + ' | ', + '