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
ae788e5f
Commit
ae788e5f
authored
Oct 04, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug with stacked charts(rotate OX)
parent
dde4a291
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
58 deletions
+59
-58
common/Charts/3DTransformation.js
common/Charts/3DTransformation.js
+59
-58
No files found.
common/Charts/3DTransformation.js
View file @
ae788e5f
...
@@ -163,7 +163,7 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
...
@@ -163,7 +163,7 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
{
{
this
.
widthCanvas
=
optimalWidth
+
(
this
.
left
+
this
.
right
);
this
.
widthCanvas
=
optimalWidth
+
(
this
.
left
+
this
.
right
);
this
.
_calculateScaleNStandard
();
this
.
_calculateScaleNStandard
();
optimalWidthLine
=
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
)
+
((
this
.
widthCanvas
-
(
this
.
left
+
this
.
right
))
/
this
.
aspectRatioX
)
/
this
.
scaleX
;
optimalWidthLine
=
Math
.
abs
(
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
)
)
+
((
this
.
widthCanvas
-
(
this
.
left
+
this
.
right
))
/
this
.
aspectRatioX
)
/
this
.
scaleX
;
kF
=
optimalWidthLine
/
widthLine
;
kF
=
optimalWidthLine
/
widthLine
;
if
(
optimalWidthLine
<
widthLine
)
if
(
optimalWidthLine
<
widthLine
)
...
@@ -173,78 +173,79 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
...
@@ -173,78 +173,79 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
}
}
else
else
{
{
this
.
aspectRatioX
=
widthLine
/
((
optimalWidthLine
-
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
))
/
kF
);
this
.
aspectRatioX
=
widthLine
/
((
optimalWidthLine
-
Math
.
abs
(
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
)))
/
kF
);
this
.
scaleY
=
this
.
scaleY
*
kF
;
this
.
scaleY
=
this
.
scaleY
*
kF
;
this
.
scaleZ
=
this
.
scaleZ
*
kF
;
this
.
scaleZ
=
this
.
scaleZ
*
kF
;
this
.
widthCanvas
=
widthCanvas
;
this
.
widthCanvas
=
widthCanvas
;
}
}
this
.
_recalculateCameraDiff
();
return
;
}
//TODO протестировать, и если не будет проблем, то убрать if-else
if
(
this
.
angleOy
!=
0
)
{
//if(this.depthPerspective * Math.sin(-this.angleOy) + ((this.widthCanvas - (this.left + this.right)) / this.aspectRatioX) / this.scaleX <= widthLine)
//return;
//рассчитываем параметры диаграммы при оптимальной ширине
this
.
widthCanvas
=
optimalWidth
+
(
this
.
left
+
this
.
right
);
this
.
calaculate3DProperties
(
null
,
null
,
true
);
var
newDepth
=
Math
.
abs
(
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
));
optimalWidthLine
=
newDepth
+
((
this
.
widthCanvas
-
(
this
.
left
+
this
.
right
))
/
this
.
aspectRatioX
)
/
this
.
scaleX
;
kF
=
optimalWidthLine
/
widthLine
;
this
.
aspectRatioX
=
widthLine
/
((
optimalWidthLine
-
newDepth
)
/
kF
);
this
.
scaleY
=
this
.
scaleY
*
kF
;
this
.
scaleZ
=
this
.
scaleZ
*
kF
;
this
.
widthCanvas
=
widthCanvas
;
this
.
_recalculateCameraDiff
();
this
.
_recalculateCameraDiff
();
}
}
else
else
{
{
//рассчитываем параметры диаграммы при оптимальной ширине
//TODO протестировать, и если не будет проблем, то убрать if-else
this
.
widthCanvas
=
optimalWidth
+
(
this
.
left
+
this
.
right
);
if
(
this
.
angleOy
!=
0
)
var
scaleX
=
this
.
scaleX
;
var
scaleY
=
this
.
scaleY
;
var
scaleZ
=
this
.
scaleZ
;
var
aspectRatioX
=
this
.
aspectRatioX
;
var
aspectRatioY
=
this
.
aspectRatioY
;
var
aspectRatioZ
=
this
.
aspectRatioZ
;
this
.
calaculate3DProperties
(
null
,
null
,
true
);
optimalWidthLine
=
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
)
+
((
this
.
widthCanvas
-
(
this
.
left
+
this
.
right
))
/
this
.
aspectRatioX
)
/
this
.
scaleX
;
if
(
optimalWidthLine
<
widthLine
)
{
{
//if(this.depthPerspective * Math.sin(-this.angleOy) + ((this.widthCanvas - (this.left + this.right)) / this.aspectRatioX) / this.scaleX <= widthLine)
//return;
//рассчитываем параметры диаграммы при оптимальной ширине
this
.
widthCanvas
=
optimalWidth
+
(
this
.
left
+
this
.
right
);
this
.
calaculate3DProperties
(
null
,
null
,
true
);
var
newDepth
=
Math
.
abs
(
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
));
optimalWidthLine
=
newDepth
+
((
this
.
widthCanvas
-
(
this
.
left
+
this
.
right
))
/
this
.
aspectRatioX
)
/
this
.
scaleX
;
kF
=
optimalWidthLine
/
widthLine
;
this
.
aspectRatioX
=
widthLine
/
((
optimalWidthLine
-
newDepth
)
/
kF
);
this
.
scaleY
=
this
.
scaleY
*
kF
;
this
.
scaleZ
=
this
.
scaleZ
*
kF
;
this
.
widthCanvas
=
widthCanvas
;
this
.
widthCanvas
=
widthCanvas
;
this
.
scaleX
=
scaleX
;
this
.
scaleY
=
scaleY
;
this
.
scaleZ
=
scaleZ
;
this
.
aspectRatioX
=
aspectRatioX
;
this
.
_recalculateCameraDiff
();
this
.
aspectRatioY
=
aspectRatioY
;
}
this
.
aspectRatioZ
=
aspectRatioZ
;
else
{
//рассчитываем параметры диаграммы при оптимальной ширине
this
.
widthCanvas
=
optimalWidth
+
(
this
.
left
+
this
.
right
);
var
scaleX
=
this
.
scaleX
;
var
scaleY
=
this
.
scaleY
;
var
scaleZ
=
this
.
scaleZ
;
var
aspectRatioX
=
this
.
aspectRatioX
;
var
aspectRatioY
=
this
.
aspectRatioY
;
var
aspectRatioZ
=
this
.
aspectRatioZ
;
this
.
calaculate3DProperties
(
null
,
null
,
true
);
optimalWidthLine
=
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
)
+
((
this
.
widthCanvas
-
(
this
.
left
+
this
.
right
))
/
this
.
aspectRatioX
)
/
this
.
scaleX
;
if
(
optimalWidthLine
<
widthLine
)
{
this
.
widthCanvas
=
widthCanvas
;
this
.
scaleX
=
scaleX
;
this
.
scaleY
=
scaleY
;
this
.
scaleZ
=
scaleZ
;
this
.
aspectRatioX
=
aspectRatioX
;
this
.
aspectRatioY
=
aspectRatioY
;
this
.
aspectRatioZ
=
aspectRatioZ
;
return
;
}
return
;
kF
=
optimalWidthLine
/
widthLine
;
this
.
aspectRatioX
=
widthLine
/
((
optimalWidthLine
-
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
))
/
kF
);
this
.
scaleY
=
this
.
scaleY
*
kF
;
this
.
scaleZ
=
this
.
scaleZ
*
kF
;
this
.
widthCanvas
=
widthCanvas
;
this
.
_recalculateCameraDiff
();
}
}
kF
=
optimalWidthLine
/
widthLine
;
this
.
aspectRatioX
=
widthLine
/
((
optimalWidthLine
-
this
.
depthPerspective
*
Math
.
sin
(
-
this
.
angleOy
))
/
kF
);
this
.
scaleY
=
this
.
scaleY
*
kF
;
this
.
scaleZ
=
this
.
scaleZ
*
kF
;
this
.
widthCanvas
=
widthCanvas
;
this
.
_recalculateCameraDiff
();
}
}
};
};
...
...
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