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
7c08124b
Commit
7c08124b
authored
Dec 14, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes for scaling
parent
9de3a1db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
65 deletions
+100
-65
common/Charts/3DTransformation.js
common/Charts/3DTransformation.js
+52
-3
common/Charts/ChartsDrawer.js
common/Charts/ChartsDrawer.js
+48
-62
No files found.
common/Charts/3DTransformation.js
View file @
7c08124b
...
...
@@ -138,6 +138,55 @@ Processor3D.prototype.calaculate3DProperties = function(baseDepth, gapDepth, bIs
this
.
_recalculateScaleWithMaxWidth
();
}
}
if
(
AscFormat
.
c_oChartTypes
.
Pie
===
this
.
chartsDrawer
.
calcProp
.
type
&&
!
this
.
view3D
.
rAngAx
)
{
//TODO пересмотреть функцию
this
.
tempChangeAspectRatioForPie
();
}
};
Processor3D
.
prototype
.
tempChangeAspectRatioForPie
=
function
()
{
var
perspectiveDepth
=
this
.
depthPerspective
;
var
widthCanvas
=
this
.
widthCanvas
;
var
originalWidthChart
=
widthCanvas
-
this
.
left
-
this
.
right
;
var
heightCanvas
=
this
.
heightCanvas
;
var
heightChart
=
heightCanvas
-
this
.
top
-
this
.
bottom
;
var
points
=
[],
faces
=
[];
points
.
push
(
new
Point3D
(
this
.
left
+
originalWidthChart
/
2
,
this
.
top
,
perspectiveDepth
,
this
));
points
.
push
(
new
Point3D
(
this
.
left
,
this
.
top
,
perspectiveDepth
/
2
,
this
));
points
.
push
(
new
Point3D
(
this
.
left
+
originalWidthChart
,
this
.
top
,
perspectiveDepth
/
2
,
this
));
points
.
push
(
new
Point3D
(
this
.
left
+
originalWidthChart
/
2
,
this
.
top
,
0
,
this
));
points
.
push
(
new
Point3D
(
this
.
left
+
originalWidthChart
/
2
,
this
.
top
+
heightChart
,
perspectiveDepth
,
this
));
points
.
push
(
new
Point3D
(
this
.
left
,
this
.
top
+
heightChart
,
perspectiveDepth
/
2
,
this
));
points
.
push
(
new
Point3D
(
this
.
left
+
originalWidthChart
,
this
.
top
+
heightChart
,
perspectiveDepth
/
2
,
this
));
points
.
push
(
new
Point3D
(
this
.
left
+
originalWidthChart
/
2
,
this
.
top
+
heightChart
,
0
,
this
));
faces
.
push
([
0
,
1
,
2
,
3
]);
faces
.
push
([
2
,
5
,
4
,
3
]);
faces
.
push
([
1
,
6
,
7
,
0
]);
faces
.
push
([
6
,
5
,
4
,
7
]);
faces
.
push
([
7
,
4
,
3
,
0
]);
faces
.
push
([
1
,
6
,
2
,
5
]);
var
minMaxOx
=
this
.
_getMinMaxOx
(
points
,
faces
);
var
minMaxOy
=
this
.
_getMinMaxOy
(
points
,
faces
);
var
kF
=
((
minMaxOx
.
right
-
minMaxOx
.
left
)
/
originalWidthChart
);
if
((
minMaxOy
.
bottom
-
minMaxOy
.
top
)
/
kF
>
heightChart
)
{
kF
=
((
minMaxOy
.
bottom
-
minMaxOy
.
top
)
/
heightChart
);
}
this
.
aspectRatioX
=
this
.
aspectRatioX
*
kF
;
this
.
aspectRatioY
=
this
.
aspectRatioY
*
kF
;
this
.
aspectRatioZ
=
this
.
aspectRatioZ
*
kF
;
};
Processor3D
.
prototype
.
calculateCommonOptions
=
function
()
...
...
@@ -1200,7 +1249,7 @@ Processor3D.prototype._calculateCameraDiff = function (/*isSkip*/)
var
points
=
[];
var
faces
=
[];
if
(
AscFormat
.
c_oChartTypes
.
Pie
===
this
.
chartsDrawer
.
calcProp
.
type
)
/*
if(AscFormat.c_oChartTypes.Pie === this.chartsDrawer.calcProp.type)
{
points.push(new Point3D(this.left + originalWidthChart / 2, this.top, perspectiveDepth, this));
points.push(new Point3D(this.left, this.top, perspectiveDepth / 2, this));
...
...
@@ -1213,7 +1262,7 @@ Processor3D.prototype._calculateCameraDiff = function (/*isSkip*/)
points.push(new Point3D(this.left + originalWidthChart / 2, this.top + heightChart, 0, this));
}
else
{
{
*/
points
.
push
(
new
Point3D
(
this
.
left
,
this
.
top
,
perspectiveDepth
,
this
));
points
.
push
(
new
Point3D
(
this
.
left
,
heightChart
+
this
.
top
,
perspectiveDepth
,
this
));
points
.
push
(
new
Point3D
(
originalWidthChart
+
this
.
left
,
heightChart
+
this
.
top
,
perspectiveDepth
,
this
));
...
...
@@ -1222,7 +1271,7 @@ Processor3D.prototype._calculateCameraDiff = function (/*isSkip*/)
points
.
push
(
new
Point3D
(
originalWidthChart
+
this
.
left
,
heightChart
+
this
.
top
,
0
,
this
));
points
.
push
(
new
Point3D
(
this
.
left
,
heightChart
+
this
.
top
,
0
,
this
));
points
.
push
(
new
Point3D
(
this
.
left
,
this
.
top
,
0
,
this
));
}
//
}
faces
.
push
([
0
,
1
,
2
,
3
]);
faces
.
push
([
2
,
5
,
4
,
3
]);
...
...
common/Charts/ChartsDrawer.js
View file @
7c08124b
...
...
@@ -7445,6 +7445,8 @@ function drawPieChart()
this
.
angleFor3D
=
null
;
this
.
properties3d
=
null
;
this
.
usually3dPropsCalc
=
[];
this
.
tempDrawOrder
=
null
;
}
drawPieChart
.
prototype
=
...
...
@@ -8501,6 +8503,11 @@ drawPieChart.prototype =
var
paths
=
this
.
_calculateSegment3DPerspective
(
radius11
,
radius12
,
radius21
,
radius22
,
angles1
[
i
],
angles2
[
i
],
center1
,
center2
,
pointCenter1
,
pointCenter2
,
Math
.
sign
(
point2
.
y
-
point6
.
y
));
if
(
null
===
this
.
tempDrawOrder
)
{
this
.
tempDrawOrder
=
Math
.
sign
(
point2
.
y
-
point6
.
y
)
<
0
?
true
:
null
;
}
if
(
!
this
.
paths
.
series
[
angles1
.
length
-
i
-
1
])
{
this
.
paths
.
series
[
angles1
.
length
-
i
-
1
]
=
[];
...
...
@@ -9134,77 +9141,56 @@ drawPieChart.prototype =
var
pen
=
numCache
[
0
].
pen
;
drawPath
(
this
.
paths
.
test
,
pen
,
null
);
//DOWN
for
(
var
i
=
0
,
len
=
numCache
.
length
;
i
<
len
;
i
++
)
var
sides
=
{
down
:
0
,
inside
:
1
,
up
:
2
,
front
:
3
};
var
drawPaths
=
function
(
side
)
{
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
++
)
{
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
].
insidePath
,
pen
,
brush
,
null
,
true
);
}
}
}
//FRONT
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
i
=
0
,
len
=
numCache
.
length
;
i
<
len
;
i
++
)
{
for
(
var
j
=
path
.
length
-
1
;
j
>=
0
;
j
--
)
var
val
=
numCache
[
i
];
var
brush
=
val
.
brush
;
var
pen
=
val
.
pen
;
var
path
=
t
.
paths
.
series
[
i
];
if
(
path
)
{
for
(
var
k
=
0
;
k
<
path
[
j
].
frontPath
.
length
;
k
++
)
for
(
var
j
=
path
.
length
-
1
;
j
>=
0
;
j
--
)
{
drawPath
(
path
[
j
].
frontPath
[
k
],
pen
,
brush
,
true
,
true
);
if
(
side
===
sides
.
down
)
{
drawPath
(
path
[
j
].
downPath
,
pen
,
null
);
}
else
if
(
side
===
sides
.
inside
)
{
drawPath
(
path
[
j
].
insidePath
,
pen
,
brush
,
null
,
true
);
}
else
if
(
side
===
sides
.
up
)
{
drawPath
(
path
[
j
].
upPath
,
pen
,
brush
);
}
else
if
(
side
===
sides
.
frontPath
)
{
for
(
var
k
=
0
;
k
<
path
[
j
].
frontPath
.
length
;
k
++
)
{
drawPath
(
path
[
j
].
frontPath
[
k
],
pen
,
brush
,
true
,
true
);
}
}
}
}
}
}
};
//UP
for
(
var
i
=
0
,
len
=
numCache
.
length
;
i
<
len
;
i
++
)
drawPaths
(
sides
.
down
);
drawPaths
(
sides
.
inside
);
if
(
this
.
tempDrawOrder
!==
null
)
{
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
].
upPath
,
pen
,
brush
);
}
}
}
drawPaths
(
sides
.
up
);
drawPaths
(
sides
.
frontPath
);
}
else
{
drawPaths
(
sides
.
frontPath
);
drawPaths
(
sides
.
up
);
}
},
_calculateTestFrame
:
function
(
point1
,
point2
,
point3
,
point4
,
point5
,
point6
,
point7
,
point8
)
...
...
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