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
fcae574f
Commit
fcae574f
authored
Oct 31, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change function for draw hBar charts
parent
3d005d56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
123 additions
and
46 deletions
+123
-46
common/Charts/ChartsDrawer.js
common/Charts/ChartsDrawer.js
+123
-46
No files found.
common/Charts/ChartsDrawer.js
View file @
fcae574f
...
...
@@ -63,6 +63,17 @@ var c_oChartTypes =
BubbleChart
:
9
};
var
c_oChartBar3dFaces
=
{
front
:
0
,
up
:
1
,
left
:
2
,
right
:
3
,
down
:
4
,
back
:
5
};
var
globalGapDepth
=
150
;
var
isTurnOn3DCharts
=
true
;
var
standartMarginForCharts
=
13
;
...
...
@@ -7102,67 +7113,133 @@ drawHBarChart.prototype =
_drawBar3D
:
function
(
path
,
pen
,
brush
,
k
)
{
//затемнение боковых сторон
//в excel всегда темные боковые стороны, лицевая и задняя стороны светлые
//pen = this.cChartSpace.chart.plotArea.valAx.compiledMajorGridLines;
//pen.setFill(brush);
var
fill
=
this
.
_getFill
(
pen
,
brush
,
k
);
var
newBrush
=
fill
.
brush
;
var
newPen
=
fill
.
pen
;
this
.
cChartDrawer
.
drawPath
(
path
,
newPen
,
newBrush
);
},
_getFill
:
function
(
pen
,
brush
,
face
)
{
//k: 0 - передняя, 1 - верхняя, 2 - левая, 3 - правая, 4 - нижняя, 5 - задняя
var
shade
=
"
shade
"
;
var
shadeValue1
=
35000
;
var
shadeValue2
=
45000
;
var
angleKf
=
60000
;
var
newBrush
=
brush
;
var
newPen
=
pen
;
var
t
=
this
;
var
applyColorModeByBrush
=
function
(
brushFill
,
val
)
{
var
props
=
t
.
cChartSpace
.
getParentObjects
();
var
duplicateBrush
=
brushFill
.
createDuplicate
();
var
cColorMod
=
new
AscFormat
.
CColorMod
;
cColorMod
.
val
=
val
;
cColorMod
.
name
=
shade
;
duplicateBrush
.
addColorMod
(
cColorMod
);
duplicateBrush
.
calculate
(
props
.
theme
,
props
.
slide
,
props
.
layout
,
props
.
master
,
new
AscFormat
.
CUniColor
().
RGBA
);
return
duplicateBrush
;
};
/*var colors = duplicateBrush.fill.colors;
if(k === 3 && colors && colors[0] && colors[0].color)
{
var tempColor = new AscFormat.CUniFill();
tempColor.setFill(new AscFormat.CSolidFill());
tempColor.fill.setColor(colors[0].color);
duplicateBrush = tempColor;
}
else if(k === 2 && colors[colors.length - 1] && colors[colors.length - 1].color)
{
var tempColor = new AscFormat.CUniFill();
tempColor.setFill(new AscFormat.CSolidFill());
tempColor.fill.setColor(colors[colors.length - 1].color);
duplicateBrush = tempColor;
}*/
var
getGradientFill
=
function
(
brushFill
,
faceIndex
)
{
if
(
brushFill
.
fill
.
lin
&&
null
!==
brushFill
.
fill
.
lin
.
angle
)
{
var
angle
=
brushFill
.
fill
.
lin
.
angle
/
angleKf
;
}
};
if
(
null
===
pen
||
(
null
!==
pen
&&
null
===
pen
.
Fill
)
||
(
null
!==
pen
&&
null
!==
pen
.
Fill
&&
null
===
pen
.
Fill
.
fill
))
{
pen
=
AscFormat
.
CreatePenFromParams
(
brush
,
undefined
,
undefined
,
undefined
,
undefined
,
0.1
);
}
if
(
k
!=
5
&&
k
!=
0
)
//TODO сделать для градиентной заливики в зависимости от угла
if
(
brush
&&
brush
.
fill
&&
AscDFH
.
historyitem_type_GradFill
===
brush
.
fill
.
getObjectType
()
)
{
var
duplicateBrush
=
brush
;
if
(
brush
)
switch
(
face
)
{
var
props
=
this
.
cChartSpace
.
getParentObjects
();
var
duplicateBrush
=
brush
.
createDuplicate
();
var
cColorMod
=
new
AscFormat
.
CColorMod
;
if
(
k
===
1
||
k
===
4
)
case
c_oChartBar3dFaces
.
front
:
case
c_oChartBar3dFaces
.
back
:
{
//для градиентной заливки верхнюю и нижнюю грань закрашиываем первым и последним цветом соотвенственно
if
(
duplicateBrush
.
fill
&&
AscDFH
.
historyitem_type_GradFill
===
duplicateBrush
.
fill
.
getObjectType
())
break
;
}
case
c_oChartBar3dFaces
.
up
:
{
break
;
}
case
c_oChartBar3dFaces
.
left
:
{
break
;
}
case
c_oChartBar3dFaces
.
right
:
{
break
;
}
case
c_oChartBar3dFaces
.
down
:
{
break
;
}
}
}
else
if
(
brush
&&
brush
.
fill
)
{
switch
(
face
)
{
case
c_oChartBar3dFaces
.
front
:
case
c_oChartBar3dFaces
.
back
:
{
break
;
}
case
c_oChartBar3dFaces
.
up
:
case
c_oChartBar3dFaces
.
down
:
{
newBrush
=
applyColorModeByBrush
(
brush
,
shadeValue1
);
if
(
null
===
pen
)
{
var
colors
=
duplicateBrush
.
fill
.
colors
;
if
(
k
===
1
&&
colors
&&
colors
[
0
]
&&
colors
[
0
].
color
)
{
var
tempColor
=
new
AscFormat
.
CUniFill
();
tempColor
.
setFill
(
new
AscFormat
.
CSolidFill
());
tempColor
.
fill
.
setColor
(
colors
[
0
].
color
);
duplicateBrush
=
tempColor
;
}
else
if
(
k
===
4
&&
colors
[
colors
.
length
-
1
]
&&
colors
[
colors
.
length
-
1
].
color
)
{
var
tempColor
=
new
AscFormat
.
CUniFill
();
tempColor
.
setFill
(
new
AscFormat
.
CSolidFill
());
tempColor
.
fill
.
setColor
(
colors
[
colors
.
length
-
1
].
color
);
duplicateBrush
=
tempColor
;
}
newPen
=
pen
.
setFill
(
newBrush
);
}
cColorMod
.
val
=
45000
;
}
else
{
cColorMod
.
val
=
35000
;
break
;
}
cColorMod
.
name
=
"
shade
"
;
duplicateBrush
.
addColorMod
(
cColorMod
);
duplicateBrush
.
calculate
(
props
.
theme
,
props
.
slide
,
props
.
layout
,
props
.
master
,
new
AscFormat
.
CUniColor
().
RGBA
);
if
(
null
===
pen
)
case
c_oChartBar3dFaces
.
left
:
case
c_oChartBar3dFaces
.
right
:
{
pen
.
setFill
(
duplicateBrush
);
newBrush
=
applyColorModeByBrush
(
brush
,
shadeValue2
);
if
(
null
===
pen
)
{
newPen
=
pen
.
setFill
(
newBrush
);
}
break
;
}
}
this
.
cChartDrawer
.
drawPath
(
path
,
pen
,
duplicateBrush
);
}
else
this
.
cChartDrawer
.
drawPath
(
path
,
pen
,
brush
)
;
return
{
brush
:
newBrush
,
pen
:
newPen
}
;
}
};
...
...
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