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
d1a54e09
Commit
d1a54e09
authored
Feb 15, 2017
by
Sergey Luzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Methods for a setting gridlines visual properties, method for changing axis labels font size.
parent
f7d09b33
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
268 additions
and
27 deletions
+268
-27
cell/apiBuilder.js
cell/apiBuilder.js
+65
-1
common/Drawings/Format/Format.js
common/Drawings/Format/Format.js
+79
-26
slide/apiBuilder.js
slide/apiBuilder.js
+62
-0
word/apiBuilder.js
word/apiBuilder.js
+62
-0
No files found.
cell/apiBuilder.js
View file @
d1a54e09
...
...
@@ -1043,6 +1043,61 @@
AscFormat
.
builder_SetChartHorAxisTickLablePosition
(
this
.
Chart
,
sTickLabelPosition
);
};
/**
* Specifies major vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart
.
prototype
.
SetMajorVerticalGridlines
=
function
(
oStroke
)
{
AscFormat
.
builder_SetVerAxisMajorGridlines
(
this
.
Chart
,
oStroke
?
oStroke
.
Ln
:
null
);
};
/**
* Specifies minor vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart
.
prototype
.
SetMinorVerticalGridlines
=
function
(
oStroke
)
{
AscFormat
.
builder_SetVerAxisMinorGridlines
(
this
.
Chart
,
oStroke
?
oStroke
.
Ln
:
null
);
};
/**
* Specifies major horizontal gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart
.
prototype
.
SetMajorHorizontalGridlines
=
function
(
oStroke
)
{
AscFormat
.
builder_SetHorAxisMajorGridlines
(
this
.
Chart
,
oStroke
?
oStroke
.
Ln
:
null
);
};
/**
* Specifies minor vertical gridline's visual properties
* @param {?ApiStroke} oStroke
*/
ApiChart
.
prototype
.
SetMinorHorizontalGridlines
=
function
(
oStroke
)
{
AscFormat
.
builder_SetHorAxisMinorGridlines
(
this
.
Chart
,
oStroke
?
oStroke
.
Ln
:
null
);
};
/**
* Specifies font size for labels of horizontal axis
* @param {number} nFontSize
*/
ApiChart
.
prototype
.
SetHorAxisLablesFontSize
=
function
(
nFontSize
){
AscFormat
.
builder_SetHorAxisFontSize
(
this
.
Chart
,
nFontSize
);
};
/**
* Specifies font size for labels of vertical axis
* @param {number} nFontSize
*/
ApiChart
.
prototype
.
SetVertAxisLablesFontSize
=
function
(
nFontSize
){
AscFormat
.
builder_SetVerAxisFontSize
(
this
.
Chart
,
nFontSize
);
};
/**
* Get the type of this class.
* @returns {"color"}
...
...
@@ -1119,6 +1174,15 @@
ApiChart
.
prototype
[
"
SetVertAxisMinorTickMark
"
]
=
ApiChart
.
prototype
.
SetVertAxisMinorTickMark
;
ApiChart
.
prototype
[
"
SetMajorVerticalGridlines
"
]
=
ApiChart
.
prototype
.
SetMajorVerticalGridlines
;
ApiChart
.
prototype
[
"
SetMinorVerticalGridlines
"
]
=
ApiChart
.
prototype
.
SetMinorVerticalGridlines
;
ApiChart
.
prototype
[
"
SetMajorHorizontalGridlines
"
]
=
ApiChart
.
prototype
.
SetMajorHorizontalGridlines
;
ApiChart
.
prototype
[
"
SetMinorHorizontalGridlines
"
]
=
ApiChart
.
prototype
.
SetMinorHorizontalGridlines
;
ApiChart
.
prototype
[
"
SetHorAxisLablesFontSize
"
]
=
ApiChart
.
prototype
.
SetHorAxisLablesFontSize
;
ApiChart
.
prototype
[
"
SetVertAxisLablesFontSize
"
]
=
ApiChart
.
prototype
.
SetVertAxisLablesFontSize
;
ApiColor
.
prototype
[
"
GetClassType
"
]
=
ApiColor
.
prototype
.
GetClassType
;
...
...
common/Drawings/Format/Format.js
View file @
d1a54e09
...
...
@@ -9999,7 +9999,6 @@ function CorrectUniColor(asc_color, unicolor, flag)
}
}
function
builder_SetChartVertAxisOrientation
(
oChartSpace
,
bIsMinMax
)
{
if
(
oChartSpace
){
var
verAxis
=
oChartSpace
.
chart
.
plotArea
.
getVerticalAxis
();
...
...
@@ -10018,7 +10017,6 @@ function CorrectUniColor(asc_color, unicolor, flag)
}
}
function
builder_SetChartHorAxisOrientation
(
oChartSpace
,
bIsMinMax
){
if
(
oChartSpace
){
var
horAxis
=
oChartSpace
.
chart
.
plotArea
.
getHorizontalAxis
();
...
...
@@ -10090,28 +10088,40 @@ function CorrectUniColor(asc_color, unicolor, flag)
}
}
function
builder_SetLegendFontSize
(
oChartSpace
,
nFontSize
){
var
oLegend
=
oChartSpace
.
chart
.
legend
;
if
(
oLegend
){
if
(
!
oLegend
.
txPr
)
function
builder_SetObjectFontSize
(
oObject
,
nFontSize
,
oDrawingDocument
){
if
(
!
oObject
){
return
;
}
if
(
!
oObject
.
txPr
)
{
oLegend
.
setTxPr
(
new
AscFormat
.
CTextBody
());
oObject
.
setTxPr
(
new
AscFormat
.
CTextBody
());
}
if
(
!
oLegend
.
txPr
.
bodyPr
)
if
(
!
oObject
.
txPr
.
bodyPr
)
{
oLegend
.
txPr
.
setBodyPr
(
new
AscFormat
.
CBodyPr
());
oObject
.
txPr
.
setBodyPr
(
new
AscFormat
.
CBodyPr
());
}
if
(
!
oLegend
.
txPr
.
content
)
if
(
!
oObject
.
txPr
.
content
)
{
oLegend
.
txPr
.
setContent
(
new
AscFormat
.
CDrawingDocContent
(
oLegend
.
txPr
,
oChartSpace
.
getDrawingDocument
()
,
0
,
0
,
100
,
500
,
false
,
false
,
true
));
oObject
.
txPr
.
setContent
(
new
AscFormat
.
CDrawingDocContent
(
oObject
.
txPr
,
oDrawingDocument
,
0
,
0
,
100
,
500
,
false
,
false
,
true
));
}
var
oPr
=
oLegend
.
txPr
.
content
.
Content
[
0
].
Pr
.
Copy
();
var
oPr
=
oObject
.
txPr
.
content
.
Content
[
0
].
Pr
.
Copy
();
if
(
!
oPr
.
DefaultRunPr
){
oPr
.
DefaultRunPr
=
new
AscCommonWord
.
CTextPr
();
}
oPr
.
DefaultRunPr
.
FontSize
=
nFontSize
;
oLegend
.
txPr
.
content
.
Content
[
0
].
Set_Pr
(
oPr
);
oObject
.
txPr
.
content
.
Content
[
0
].
Set_Pr
(
oPr
);
}
function
builder_SetLegendFontSize
(
oChartSpace
,
nFontSize
){
builder_SetObjectFontSize
(
oChartSpace
.
chart
.
legend
,
nFontSize
,
oChartSpace
.
getDrawingDocument
());
}
function
builder_SetHorAxisFontSize
(
oChartSpace
,
nFontSize
){
builder_SetObjectFontSize
(
oChartSpace
.
chart
.
plotArea
.
getHorizontalAxis
(),
nFontSize
,
oChartSpace
.
getDrawingDocument
());
}
function
builder_SetVerAxisFontSize
(
oChartSpace
,
nFontSize
){
builder_SetObjectFontSize
(
oChartSpace
.
chart
.
plotArea
.
getVerticalAxis
(),
nFontSize
,
oChartSpace
.
getDrawingDocument
());
}
function
builder_SetShowDataLabels
(
oChartSpace
,
bShowSerName
,
bShowCatName
,
bShowVal
,
bShowPerecent
){
...
...
@@ -10142,7 +10152,6 @@ function CorrectUniColor(asc_color, unicolor, flag)
}
}
function
builder_SetChartAxisLabelsPos
(
oAxis
,
sPosition
){
if
(
!
oAxis
||
!
oAxis
.
setTickLblPos
){
return
;
...
...
@@ -10177,13 +10186,13 @@ function CorrectUniColor(asc_color, unicolor, flag)
builder_SetChartAxisLabelsPos
(
oChartSpace
.
chart
.
plotArea
.
getVerticalAxis
(),
sPosition
);
}
}
function
builder_SetChartHorAxisTickLablePosition
(
oChartSpace
,
sPosition
){
if
(
oChartSpace
){
builder_SetChartAxisLabelsPos
(
oChartSpace
.
chart
.
plotArea
.
getHorizontalAxis
(),
sPosition
);
}
}
function
builder_GetTickMark
(
sTickMark
){
var
nNewTickMark
=
null
;
switch
(
sTickMark
){
...
...
@@ -10220,6 +10229,7 @@ function CorrectUniColor(asc_color, unicolor, flag)
oAxis
.
setMajorTickMark
(
nNewTickMark
);
}
}
function
builder_SetChartAxisMinorTickMark
(
oAxis
,
sTickMark
){
if
(
!
oAxis
){
return
;
...
...
@@ -10235,6 +10245,7 @@ function CorrectUniColor(asc_color, unicolor, flag)
builder_SetChartAxisMajorTickMark
(
oChartSpace
.
chart
.
plotArea
.
getHorizontalAxis
(),
sTickMark
);
}
}
function
builder_SetChartHorAxisMinorTickMark
(
oChartSpace
,
sTickMark
){
if
(
oChartSpace
){
builder_SetChartAxisMinorTickMark
(
oChartSpace
.
chart
.
plotArea
.
getHorizontalAxis
(),
sTickMark
);
...
...
@@ -10246,12 +10257,48 @@ function CorrectUniColor(asc_color, unicolor, flag)
builder_SetChartAxisMajorTickMark
(
oChartSpace
.
chart
.
plotArea
.
getVerticalAxis
(),
sTickMark
);
}
}
function
builder_SetChartVerAxisMinorTickMark
(
oChartSpace
,
sTickMark
){
if
(
oChartSpace
){
builder_SetChartAxisMinorTickMark
(
oChartSpace
.
chart
.
plotArea
.
getVerticalAxis
(),
sTickMark
);
}
}
function
builder_SetAxisMajorGridlines
(
oAxis
,
oLn
){
if
(
oAxis
){
if
(
!
oAxis
.
majorGridlines
){
oAxis
.
setMajorGridlines
(
new
AscFormat
.
CSpPr
());
}
oAxis
.
majorGridlines
.
setLn
(
oLn
);
if
(
!
oAxis
.
majorGridlines
.
Fill
&&
!
oAxis
.
majorGridlines
.
ln
){
oAxis
.
setMajorGridlines
(
null
);
}
}
}
function
builder_SetAxisMinorGridlines
(
oAxis
,
oLn
){
if
(
oAxis
){
if
(
!
oAxis
.
minorGridlines
){
oAxis
.
setMinorGridlines
(
new
AscFormat
.
CSpPr
());
}
oAxis
.
minorGridlines
.
setLn
(
oLn
);
if
(
!
oAxis
.
minorGridlines
.
Fill
&&
!
oAxis
.
minorGridlines
.
ln
){
oAxis
.
setMinorGridlines
(
null
);
}
}
}
function
builder_SetHorAxisMajorGridlines
(
oChartSpace
,
oLn
){
builder_SetAxisMajorGridlines
(
oChartSpace
.
chart
.
plotArea
.
getVerticalAxis
(),
oLn
);
}
function
builder_SetHorAxisMinorGridlines
(
oChartSpace
,
oLn
){
builder_SetAxisMinorGridlines
(
oChartSpace
.
chart
.
plotArea
.
getVerticalAxis
(),
oLn
);
}
function
builder_SetVerAxisMajorGridlines
(
oChartSpace
,
oLn
){
builder_SetAxisMajorGridlines
(
oChartSpace
.
chart
.
plotArea
.
getHorizontalAxis
(),
oLn
);
}
function
builder_SetVerAxisMinorGridlines
(
oChartSpace
,
oLn
){
builder_SetAxisMinorGridlines
(
oChartSpace
.
chart
.
plotArea
.
getHorizontalAxis
(),
oLn
);
}
//----------------------------------------------------------export----------------------------------------------------
window
[
'
AscFormat
'
]
=
window
[
'
AscFormat
'
]
||
{};
...
...
@@ -10380,6 +10427,12 @@ function CorrectUniColor(asc_color, unicolor, flag)
window
[
'
AscFormat
'
].
builder_SetChartVerAxisMajorTickMark
=
builder_SetChartVerAxisMajorTickMark
;
window
[
'
AscFormat
'
].
builder_SetChartVerAxisMinorTickMark
=
builder_SetChartVerAxisMinorTickMark
;
window
[
'
AscFormat
'
].
builder_SetLegendFontSize
=
builder_SetLegendFontSize
;
window
[
'
AscFormat
'
].
builder_SetHorAxisMajorGridlines
=
builder_SetHorAxisMajorGridlines
;
window
[
'
AscFormat
'
].
builder_SetHorAxisMinorGridlines
=
builder_SetHorAxisMinorGridlines
;
window
[
'
AscFormat
'
].
builder_SetVerAxisMajorGridlines
=
builder_SetVerAxisMajorGridlines
;
window
[
'
AscFormat
'
].
builder_SetVerAxisMinorGridlines
=
builder_SetVerAxisMinorGridlines
;
window
[
'
AscFormat
'
].
builder_SetHorAxisFontSize
=
builder_SetHorAxisFontSize
;
window
[
'
AscFormat
'
].
builder_SetVerAxisFontSize
=
builder_SetVerAxisFontSize
;
...
...
slide/apiBuilder.js
View file @
d1a54e09
...
...
@@ -765,6 +765,62 @@
/**
* Specifies major vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart
.
prototype
.
SetMajorVerticalGridlines
=
function
(
oStroke
)
{
AscFormat
.
builder_SetVerAxisMajorGridlines
(
this
.
Chart
,
oStroke
?
oStroke
.
Ln
:
null
);
};
/**
* Specifies minor vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart
.
prototype
.
SetMinorVerticalGridlines
=
function
(
oStroke
)
{
AscFormat
.
builder_SetVerAxisMinorGridlines
(
this
.
Chart
,
oStroke
?
oStroke
.
Ln
:
null
);
};
/**
* Specifies major horizontal gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart
.
prototype
.
SetMajorHorizontalGridlines
=
function
(
oStroke
)
{
AscFormat
.
builder_SetHorAxisMajorGridlines
(
this
.
Chart
,
oStroke
?
oStroke
.
Ln
:
null
);
};
/**
* Specifies minor vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart
.
prototype
.
SetMinorHorizontalGridlines
=
function
(
oStroke
)
{
AscFormat
.
builder_SetHorAxisMinorGridlines
(
this
.
Chart
,
oStroke
?
oStroke
.
Ln
:
null
);
};
/**
* Specifies font size for labels of horizontal axis
* @param {number} nFontSize
*/
ApiChart
.
prototype
.
SetHorAxisLablesFontSize
=
function
(
nFontSize
){
AscFormat
.
builder_SetHorAxisFontSize
(
this
.
Chart
,
nFontSize
);
};
/**
* Specifies font size for labels of vertical axis
* @param {number} nFontSize
*/
ApiChart
.
prototype
.
SetVertAxisLablesFontSize
=
function
(
nFontSize
){
AscFormat
.
builder_SetVerAxisFontSize
(
this
.
Chart
,
nFontSize
);
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Export
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -817,6 +873,12 @@
ApiChart
.
prototype
[
"
SetHorAxisMinorTickMark
"
]
=
ApiChart
.
prototype
.
SetHorAxisMinorTickMark
;
ApiChart
.
prototype
[
"
SetVertAxisMajorTickMark
"
]
=
ApiChart
.
prototype
.
SetVertAxisMajorTickMark
;
ApiChart
.
prototype
[
"
SetVertAxisMinorTickMark
"
]
=
ApiChart
.
prototype
.
SetVertAxisMinorTickMark
;
ApiChart
.
prototype
[
"
SetMajorVerticalGridlines
"
]
=
ApiChart
.
prototype
.
SetMajorVerticalGridlines
;
ApiChart
.
prototype
[
"
SetMinorVerticalGridlines
"
]
=
ApiChart
.
prototype
.
SetMinorVerticalGridlines
;
ApiChart
.
prototype
[
"
SetMajorHorizontalGridlines
"
]
=
ApiChart
.
prototype
.
SetMajorHorizontalGridlines
;
ApiChart
.
prototype
[
"
SetMinorHorizontalGridlines
"
]
=
ApiChart
.
prototype
.
SetMinorHorizontalGridlines
;
ApiChart
.
prototype
[
"
SetHorAxisLablesFontSize
"
]
=
ApiChart
.
prototype
.
SetHorAxisLablesFontSize
;
ApiChart
.
prototype
[
"
SetVertAxisLablesFontSize
"
]
=
ApiChart
.
prototype
.
SetVertAxisLablesFontSize
;
function
private_GetCurrentSlide
(){
var
oApiPresentation
=
editor
.
GetPresentation
();
...
...
word/apiBuilder.js
View file @
d1a54e09
...
...
@@ -4127,6 +4127,62 @@
};
/**
* Specifies major vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart
.
prototype
.
SetMajorVerticalGridlines
=
function
(
oStroke
)
{
AscFormat
.
builder_SetVerAxisMajorGridlines
(
this
.
Chart
,
oStroke
?
oStroke
.
Ln
:
null
);
};
/**
* Specifies minor vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart
.
prototype
.
SetMinorVerticalGridlines
=
function
(
oStroke
)
{
AscFormat
.
builder_SetVerAxisMinorGridlines
(
this
.
Chart
,
oStroke
?
oStroke
.
Ln
:
null
);
};
/**
* Specifies major horizontal gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart
.
prototype
.
SetMajorHorizontalGridlines
=
function
(
oStroke
)
{
AscFormat
.
builder_SetHorAxisMajorGridlines
(
this
.
Chart
,
oStroke
?
oStroke
.
Ln
:
null
);
};
/**
* Specifies minor vertical gridline's visual properties
* @param {?ApiStroke} oStroke
* */
ApiChart
.
prototype
.
SetMinorHorizontalGridlines
=
function
(
oStroke
)
{
AscFormat
.
builder_SetHorAxisMinorGridlines
(
this
.
Chart
,
oStroke
?
oStroke
.
Ln
:
null
);
};
/**
* Specifies font size for labels of horizontal axis
* @param {number} nFontSize
*/
ApiChart
.
prototype
.
SetHorAxisLablesFontSize
=
function
(
nFontSize
){
AscFormat
.
builder_SetHorAxisFontSize
(
this
.
Chart
,
nFontSize
);
};
/**
* Specifies font size for labels of vertical axis
* @param {number} nFontSize
*/
ApiChart
.
prototype
.
SetVertAxisLablesFontSize
=
function
(
nFontSize
){
AscFormat
.
builder_SetVerAxisFontSize
(
this
.
Chart
,
nFontSize
);
};
//------------------------------------------------------------------------------------------------------------------
//
// ApiFill
...
...
@@ -4491,6 +4547,12 @@
ApiChart
.
prototype
[
"
SetHorAxisMinorTickMark
"
]
=
ApiChart
.
prototype
.
SetHorAxisMinorTickMark
;
ApiChart
.
prototype
[
"
SetVertAxisMajorTickMark
"
]
=
ApiChart
.
prototype
.
SetVertAxisMajorTickMark
;
ApiChart
.
prototype
[
"
SetVertAxisMinorTickMark
"
]
=
ApiChart
.
prototype
.
SetVertAxisMinorTickMark
;
ApiChart
.
prototype
[
"
SetMajorVerticalGridlines
"
]
=
ApiChart
.
prototype
.
SetMajorVerticalGridlines
;
ApiChart
.
prototype
[
"
SetMinorVerticalGridlines
"
]
=
ApiChart
.
prototype
.
SetMinorVerticalGridlines
;
ApiChart
.
prototype
[
"
SetMajorHorizontalGridlines
"
]
=
ApiChart
.
prototype
.
SetMajorHorizontalGridlines
;
ApiChart
.
prototype
[
"
SetMinorHorizontalGridlines
"
]
=
ApiChart
.
prototype
.
SetMinorHorizontalGridlines
;
ApiChart
.
prototype
[
"
SetHorAxisLablesFontSize
"
]
=
ApiChart
.
prototype
.
SetHorAxisLablesFontSize
;
ApiChart
.
prototype
[
"
SetVertAxisLablesFontSize
"
]
=
ApiChart
.
prototype
.
SetVertAxisLablesFontSize
;
ApiFill
.
prototype
[
"
GetClassType
"
]
=
ApiFill
.
prototype
.
GetClassType
;
...
...
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