Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
e39530c1
Commit
e39530c1
authored
Apr 03, 2017
by
SergeyLuzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change chart's range when apply preset
parent
12f52d48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
26 deletions
+30
-26
common/Drawings/CommonController.js
common/Drawings/CommonController.js
+30
-26
No files found.
common/Drawings/CommonController.js
View file @
e39530c1
...
...
@@ -2857,6 +2857,32 @@ DrawingObjectsController.prototype =
}
//Title Settings
chart_space
.
setChart
(
chart_space
.
chart
.
createDuplicate
());
/*if(AscFormat.isRealNumber(style_index) && style_index > 0 && style_index < 49 && chart_space.style !== style_index)
{
if(!b_clear_formatting)
{
chart_space.clearFormatting();
}
chart_space.setStyle(style_index);
}*/
var
chart
=
chart_space
.
chart
;
var
plot_area
=
chart
.
plotArea
;
var
type
=
chartSettings
.
getType
();
if
(
AscFormat
.
isRealNumber
(
style_index
)){
--
style_index
;
var
oCurChartSettings
=
this
.
getPropsFromChart
(
chartSpace
);
var
_cur_type
=
oCurChartSettings
.
type
;
if
(
AscCommon
.
g_oChartPresets
[
_cur_type
]
&&
AscCommon
.
g_oChartPresets
[
_cur_type
][
style_index
]){
plot_area
.
removeCharts
(
1
,
plot_area
.
charts
.
length
-
1
);
AscFormat
.
ApplyPresetToChartSpace
(
chartSpace
,
AscCommon
.
g_oChartPresets
[
_cur_type
][
style_index
],
chartSettings
.
bCreate
);
return
;
}
}
chart_space
.
setStyle
(
chart_space
.
style
);
if
(
this
.
drawingObjects
&&
this
.
drawingObjects
.
getWorksheet
&&
typeof
sRange
===
"
string
"
&&
sRange
.
length
>
0
)
{
...
...
@@ -2883,17 +2909,17 @@ DrawingObjectsController.prototype =
if
(
!
(
chart_space
.
bbox
&&
chart_space
.
bbox
.
seriesBBox
&&
b_equal_ws
&&
b_equal_bbox
&&
b_equal_vert
)
&&
!
bLimit
)
{
var
catHeadersBBox
,
serHeadersBBox
;
var
catHeadersBBox
,
serHeadersBBox
;
if
(
chart_space
.
bbox
&&
b_equal_bbox
&&
b_equal_ws
&&
!
b_equal_vert
)
{
if
(
chart_space
.
bbox
.
catBBox
)
serHeadersBBox
=
{
r1
:
chart_space
.
bbox
.
catBBox
.
r1
,
r2
:
chart_space
.
bbox
.
catBBox
.
r2
,
c1
:
chart_space
.
bbox
.
catBBox
.
c1
,
c2
:
chart_space
.
bbox
.
catBBox
.
c2
};
c1
:
chart_space
.
bbox
.
catBBox
.
c1
,
c2
:
chart_space
.
bbox
.
catBBox
.
c2
};
if
(
chart_space
.
bbox
.
serBBox
)
catHeadersBBox
=
{
r1
:
chart_space
.
bbox
.
serBBox
.
r1
,
r2
:
chart_space
.
bbox
.
serBBox
.
r2
,
c1
:
chart_space
.
bbox
.
serBBox
.
c1
,
c2
:
chart_space
.
bbox
.
serBBox
.
c2
};
c1
:
chart_space
.
bbox
.
serBBox
.
c1
,
c2
:
chart_space
.
bbox
.
serBBox
.
c2
};
}
var
chartSeries
=
AscFormat
.
getChartSeries
(
ws_view
.
model
,
chartSettings
,
catHeadersBBox
,
serHeadersBBox
);
var
chartSeries
=
AscFormat
.
getChartSeries
(
ws_view
.
model
,
chartSettings
,
catHeadersBBox
,
serHeadersBBox
);
//chart_space.clearFormatting(true);
b_clear_formatting
=
true
;
chart_space
.
rebuildSeriesFromAsc
(
chartSeries
);
...
...
@@ -2901,29 +2927,7 @@ DrawingObjectsController.prototype =
}
}
/*if(AscFormat.isRealNumber(style_index) && style_index > 0 && style_index < 49 && chart_space.style !== style_index)
{
if(!b_clear_formatting)
{
chart_space.clearFormatting();
}
chart_space.setStyle(style_index);
}*/
var
chart
=
chart_space
.
chart
;
var
plot_area
=
chart
.
plotArea
;
var
type
=
chartSettings
.
getType
();
if
(
AscFormat
.
isRealNumber
(
style_index
)){
--
style_index
;
var
oCurChartSettings
=
this
.
getPropsFromChart
(
chartSpace
);
var
_cur_type
=
oCurChartSettings
.
type
;
if
(
AscCommon
.
g_oChartPresets
[
_cur_type
]
&&
AscCommon
.
g_oChartPresets
[
_cur_type
][
style_index
]){
plot_area
.
removeCharts
(
1
,
plot_area
.
charts
.
length
-
1
);
AscFormat
.
ApplyPresetToChartSpace
(
chartSpace
,
AscCommon
.
g_oChartPresets
[
_cur_type
][
style_index
],
chartSettings
.
bCreate
);
return
;
}
}
var
title_show_settings
=
chartSettings
.
getTitle
();
if
(
title_show_settings
===
c_oAscChartTitleShowSettings
.
none
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment