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
4725e76d
Commit
4725e76d
authored
Mar 23, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
сортирую по z-index все грани(3d bar chart)
parent
9893bf2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
20 deletions
+69
-20
common/Charts/ChartsDrawer.js
common/Charts/ChartsDrawer.js
+69
-20
No files found.
common/Charts/ChartsDrawer.js
View file @
4725e76d
...
...
@@ -2749,7 +2749,14 @@ drawBarChart.prototype =
{
paths
=
this
.
_calculateRect3D
(
startX
,
startY
,
individualBarWidth
,
height
,
val
,
isValMoreZero
,
isValLessZero
,
i
);
this
.
sortZIndexPaths
.
push
({
seria
:
i
,
point
:
idx
,
paths
:
paths
.
paths
,
x
:
paths
.
x
,
y
:
paths
.
y
,
zIndex
:
paths
.
zIndex
});
//расскомментируем, чтобы включить старую схему отрисовки(+ переименовать функции _DrawBars3D -> _DrawBars3D2)
//this.sortZIndexPaths.push({seria: i, point: idx, paths: paths.paths, x: paths.x, y: paths.y, zIndex: paths.zIndex});
for
(
var
k
=
0
;
k
<
paths
.
paths
.
length
;
k
++
)
{
this
.
sortZIndexPaths
.
push
({
seria
:
i
,
point
:
idx
,
verge
:
k
,
paths
:
paths
.
paths
[
k
],
x
:
paths
.
sortPaths
[
k
].
x
,
y
:
paths
.
sortPaths
[
k
].
y
,
zIndex
:
paths
.
sortPaths
[
k
].
z
});
}
paths
=
paths
.
paths
;
}
else
...
...
@@ -2972,7 +2979,8 @@ drawBarChart.prototype =
},
_DrawBars3D
:
function
()
//TODO delete after test
_DrawBars3D2
:
function
()
{
var
t
=
this
;
var
processor3D
=
this
.
cChartDrawer
.
processor3D
;
...
...
@@ -2986,22 +2994,22 @@ drawBarChart.prototype =
up
:
4
,
unfront
:
5
};
var
drawVerges
=
function
(
i
,
j
,
paths
,
onlyLessNull
,
start
,
stop
)
{
var
brush
,
pen
,
options
;
options
=
t
.
_getOptionsForDrawing
(
i
,
j
,
onlyLessNull
);
if
(
options
!==
null
)
{
pen
=
options
.
pen
;
brush
=
options
.
brush
;
for
(
var
k
=
start
;
k
<=
stop
;
k
++
)
{
t
.
_drawBar3D
(
paths
[
k
],
pen
,
brush
,
k
);
}
}
};
var
drawVerges
=
function
(
i
,
j
,
paths
,
onlyLessNull
,
start
,
stop
)
{
var
brush
,
pen
,
options
;
options
=
t
.
_getOptionsForDrawing
(
i
,
j
,
onlyLessNull
);
if
(
options
!==
null
)
{
pen
=
options
.
pen
;
brush
=
options
.
brush
;
for
(
var
k
=
start
;
k
<=
stop
;
k
++
)
{
t
.
_drawBar3D
(
paths
[
k
],
pen
,
brush
,
k
);
}
}
};
var
draw
=
function
(
onlyLessNull
,
start
,
stop
)
{
...
...
@@ -3010,7 +3018,7 @@ drawBarChart.prototype =
drawVerges
(
t
.
sortZIndexPaths
[
i
].
seria
,
t
.
sortZIndexPaths
[
i
].
point
,
t
.
sortZIndexPaths
[
i
].
paths
,
onlyLessNull
,
start
,
stop
);
}
};
if
(
this
.
chartProp
.
subType
===
"
standard
"
)
{
draw
(
true
,
verges
.
front
,
verges
.
unfront
);
...
...
@@ -3029,6 +3037,35 @@ drawBarChart.prototype =
}
},
_DrawBars3D
:
function
()
{
var
t
=
this
;
var
processor3D
=
this
.
cChartDrawer
.
processor3D
;
var
drawVerges
=
function
(
i
,
j
,
paths
,
onlyLessNull
,
k
)
{
var
brush
,
pen
,
options
;
options
=
t
.
_getOptionsForDrawing
(
i
,
j
,
onlyLessNull
);
if
(
paths
!==
null
&&
options
!==
null
)
{
pen
=
options
.
pen
;
brush
=
options
.
brush
;
t
.
_drawBar3D
(
paths
,
pen
,
brush
,
k
);
}
};
for
(
var
i
=
0
;
i
<
this
.
sortZIndexPaths
.
length
;
i
++
)
{
drawVerges
(
this
.
sortZIndexPaths
[
i
].
seria
,
this
.
sortZIndexPaths
[
i
].
point
,
this
.
sortZIndexPaths
[
i
].
paths
,
true
,
this
.
sortZIndexPaths
[
i
].
verge
);
}
for
(
var
i
=
0
;
i
<
this
.
sortZIndexPaths
.
length
;
i
++
)
{
drawVerges
(
this
.
sortZIndexPaths
[
i
].
seria
,
this
.
sortZIndexPaths
[
i
].
point
,
this
.
sortZIndexPaths
[
i
].
paths
,
false
,
this
.
sortZIndexPaths
[
i
].
verge
);
}
},
_getOptionsForDrawing
:
function
(
ser
,
point
,
onlyLessNull
)
{
var
seria
=
this
.
chartProp
.
series
[
ser
];
...
...
@@ -3123,7 +3160,19 @@ drawBarChart.prototype =
isNotDrawDownVerge = true;*/
var
paths
=
this
.
cChartDrawer
.
calculateRect3D
(
point1
,
point2
,
point3
,
point4
,
point5
,
point6
,
point7
,
point8
,
val
,
isNotDrawDownVerge
);
return
{
paths
:
paths
,
x
:
point1
.
x
,
y
:
point1
.
y
,
zIndex
:
point1
.
z
};
var
controlPoint1
=
this
.
cChartDrawer
.
_convertAndTurnPoint
(
x1
+
individualBarWidth
/
2
,
y1
-
height
/
2
,
z1
);
var
controlPoint2
=
this
.
cChartDrawer
.
_convertAndTurnPoint
(
x1
+
individualBarWidth
/
2
,
y1
,
z1
+
perspectiveDepth
/
2
);
var
controlPoint3
=
this
.
cChartDrawer
.
_convertAndTurnPoint
(
x1
,
y1
-
height
/
2
,
z1
+
perspectiveDepth
/
2
);
var
controlPoint4
=
this
.
cChartDrawer
.
_convertAndTurnPoint
(
x4
,
y4
-
height
/
2
,
z4
+
perspectiveDepth
/
2
);
var
controlPoint5
=
this
.
cChartDrawer
.
_convertAndTurnPoint
(
x5
+
individualBarWidth
/
2
,
y5
,
z5
+
perspectiveDepth
/
2
);
var
controlPoint6
=
this
.
cChartDrawer
.
_convertAndTurnPoint
(
x2
+
individualBarWidth
/
2
,
y2
-
height
/
2
,
z2
);
var
sortPaths
=
[
controlPoint1
,
controlPoint2
,
controlPoint3
,
controlPoint4
,
controlPoint5
,
controlPoint6
];
return
{
paths
:
paths
,
x
:
point1
.
x
,
y
:
point1
.
y
,
zIndex
:
point1
.
z
,
sortPaths
:
sortPaths
};
}
}
...
...
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