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
868513b4
Commit
868513b4
authored
Oct 27, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ previous revision
parent
5d829dce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
26 deletions
+63
-26
common/Charts/ChartsDrawer.js
common/Charts/ChartsDrawer.js
+63
-26
No files found.
common/Charts/ChartsDrawer.js
View file @
868513b4
...
...
@@ -8081,15 +8081,12 @@ drawPieChart.prototype =
var
swapAngle
=
Math
.
abs
((
parseFloat
(
partOfSum
))
*
(
Math
.
PI
*
2
));
if
(
!
this
.
paths
.
series
)
this
.
paths
.
series
=
[];
if
(
sumData
===
0
)
//TODO стоит пересмотреть
{
this
.
paths
.
series
[
i
]
=
this
.
_calculateEmptySegment
(
radius
,
xCenter
,
yCenter
);
}
else
{
this
.
paths
.
series
[
i
]
=
this
.
_calculateSegment3D
(
startAngle
,
swapAngle
,
radius
,
xCenter
,
yCenter
);
this
.
paths
.
series
=
[];
}
this
.
paths
.
series
[
i
]
=
this
.
_calculateSegment3D
(
startAngle
,
swapAngle
,
radius
,
xCenter
,
yCenter
);
startAngle
+=
swapAngle
;
}
},
...
...
@@ -8243,6 +8240,23 @@ drawPieChart.prototype =
path
.
recalculate
(
gdLst
);
return
path
;
};
var
calculateDownFace
=
function
(
startAng
,
swapAng
)
{
var
path
=
getNewPath
();
var
endAng
=
startAng
+
swapAng
;
var
p
=
getSegmentPoints
(
startAng
,
endAng
);
path
.
moveTo
(
xCenter
/
pxToMm
*
pathW
,
(
yCenter
+
depth
)
/
pxToMm
*
pathH
);
path
.
lnTo
(
p
.
x0
/
pxToMm
*
pathW
,
(
p
.
y0
+
depth
)
/
pxToMm
*
pathH
);
path
.
arcTo
(
radius1
/
pxToMm
*
pathW
,
radius2
/
pxToMm
*
pathH
,
-
1
*
stAng
*
cToDeg
,
-
1
*
swapAng
*
cToDeg
);
path
.
lnTo
(
xCenter
/
pxToMm
*
pathW
,
(
yCenter
+
depth
)
/
pxToMm
*
pathH
);
path
.
recalculate
(
gdLst
);
return
path
;
}
...
...
@@ -8268,9 +8282,12 @@ drawPieChart.prototype =
//UP FACE
var
upPath
=
calculateUpFace
(
stAng
,
swAng
);
//DOWN FACE
var
downPath
=
calculateDownFace
(
stAng
,
swAng
);
this
.
angleFor3D
+=
swAng
;
return
{
frontPath
:
frontPath
,
upPath
:
upPath
,
insidePath
:
insidePath
};
return
{
frontPath
:
frontPath
,
upPath
:
upPath
,
insidePath
:
insidePath
,
downPath
:
downPath
};
},
_calculateSegment3D
:
function
(
startAngle
,
swapAngle
,
radius
,
xCenter
,
yCenter
)
...
...
@@ -8303,25 +8320,28 @@ drawPieChart.prototype =
{
if
(
path
)
{
var
props
=
t
.
cChartSpace
.
getParentObjects
();
var
duplicateBrush
=
brush
.
createDuplicate
();
var
cColorMod
=
new
AscFormat
.
CColorMod
;
cColorMod
.
val
=
shadeValue
;
cColorMod
.
name
=
shade
;
if
(
duplicateBrush
.
fill
.
color
)
{
duplicateBrush
.
fill
.
color
.
Mods
.
addMod
(
cColorMod
);
duplicateBrush
.
calculate
(
props
.
theme
,
props
.
slide
,
props
.
layout
,
props
.
master
,
new
AscFormat
.
CUniColor
().
RGBA
);
}
if
(
isShadePen
)
if
(
brush
)
{
pen
=
AscFormat
.
CreatePenFromParams
(
duplicateBrush
,
undefined
,
undefined
,
undefined
,
undefined
,
0
);
}
if
(
isShadeBrush
)
{
brush
=
duplicateBrush
;
var
props
=
t
.
cChartSpace
.
getParentObjects
();
var
duplicateBrush
=
brush
.
createDuplicate
();
var
cColorMod
=
new
AscFormat
.
CColorMod
;
cColorMod
.
val
=
shadeValue
;
cColorMod
.
name
=
shade
;
if
(
duplicateBrush
)
{
duplicateBrush
.
addColorMod
(
cColorMod
);
duplicateBrush
.
calculate
(
props
.
theme
,
props
.
slide
,
props
.
layout
,
props
.
master
,
new
AscFormat
.
CUniColor
().
RGBA
);
}
if
(
isShadePen
)
{
pen
=
AscFormat
.
CreatePenFromParams
(
duplicateBrush
,
undefined
,
undefined
,
undefined
,
undefined
,
0
);
}
if
(
isShadeBrush
)
{
brush
=
duplicateBrush
;
}
}
t
.
cChartDrawer
.
drawPath
(
path
,
pen
,
brush
);
...
...
@@ -8329,6 +8349,23 @@ drawPieChart.prototype =
};
//DOWN
for
(
var
i
=
0
,
len
=
numCache
.
length
;
i
<
len
;
i
++
)
{
var
val
=
numCache
[
i
];
var
brush
=
val
.
brush
;
var
pen
=
val
.
pen
;
var
path
=
this
.
paths
.
series
[
i
];
if
(
path
)
{
for
(
var
j
=
path
.
length
-
1
;
j
>=
0
;
j
--
)
{
drawPath
(
path
[
j
].
downPath
,
pen
,
null
);
}
}
}
//INSIDE
for
(
var
i
=
0
,
len
=
numCache
.
length
;
i
<
len
;
i
++
)
{
...
...
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