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
9c03628d
Commit
9c03628d
authored
Sep 02, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change function _calculateData2
parent
e7d5af3b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
63 deletions
+54
-63
common/Charts/ChartsDrawer.js
common/Charts/ChartsDrawer.js
+54
-63
No files found.
common/Charts/ChartsDrawer.js
View file @
9c03628d
...
...
@@ -1152,76 +1152,56 @@ CChartsDrawer.prototype =
}
},
_calculateData2
:
function
(
chart
)
{
var
max
=
0
;
var
min
=
0
;
var
minY
=
0
;
var
maxY
=
0
;
var
xNumCache
,
yNumCache
,
newArr
;
var
series
=
chart
.
chart
.
plotArea
.
chart
.
series
;
if
(
this
.
calcProp
.
type
!=
'
Scatter
'
)
//берём данные из NumCache
_calculateData2
:
function
(
chart
)
{
var
arrValues
=
[]
;
var
isSkip
=
[]
;
var
skipSeries
=
[]
;
var
xNumCache
,
yNumCache
,
newArr
,
arrValues
=
[],
max
=
0
,
min
=
0
,
minY
=
0
,
maxY
=
0
;
var
series
=
chart
.
chart
.
plotArea
.
chart
.
series
;
var
t
=
this
;
var
isEn
=
false
;
var
isEnY
=
false
;
var
generateArrValues
=
function
()
{
var
numSeries
=
0
;
var
curSeria
;
var
isNumberVal
=
true
;
for
(
var
l
=
0
;
l
<
series
.
length
;
++
l
)
for
(
var
l
=
0
;
l
<
series
.
length
;
l
++
)
{
var
firstCol
=
0
;
var
firstRow
=
0
;
curSeria
=
series
[
l
].
val
.
numRef
&&
series
[
l
].
val
.
numRef
.
numCache
?
series
[
l
].
val
.
numRef
.
numCache
.
pts
:
series
[
l
].
val
.
numLit
?
series
[
l
].
val
.
numLit
.
pts
:
null
;
var
seria
=
series
[
l
];
var
numCache
=
seria
.
val
.
numRef
&&
seria
.
val
.
numRef
.
numCache
?
seria
.
val
.
numRef
.
numCache
:
seria
.
val
.
numLit
?
seria
.
val
.
numLit
:
null
;
var
pts
=
numCache
?
numCache
.
pts
:
null
;
skipSeries
[
l
]
=
true
;
if
(
series
[
l
].
isHidden
==
true
)
continue
;
if
(
!
curSeria
||
!
curSeria
.
length
)
if
(
!
pts
||
!
pts
.
length
||
seria
.
isHidden
==
true
)
{
continue
;
}
skipSeries
[
l
]
=
false
;
arrValues
[
numSeries
]
=
[];
isSkip
[
numSeries
]
=
true
;
var
row
=
firstRow
;
var
n
=
0
;
for
(
var
col
=
firstCol
;
col
<
curSeria
.
length
;
++
col
)
arrValues
[
numSeries
]
=
[];
for
(
var
col
=
0
;
col
<
numCache
.
ptCount
;
col
++
)
{
if
(
!
curSeria
[
col
])
var
curPoint
=
t
.
getIdxPoint
(
seria
,
col
);
if
(
!
curPoint
)
{
cur
Seria
[
col
]
=
{
val
:
0
};
cur
Point
=
{
val
:
0
};
}
else
if
(
cur
Seria
[
col
]
.
isHidden
==
true
)
else
if
(
cur
Point
.
isHidden
==
true
)
{
continue
;
}
var
cell
=
curSeria
[
col
];
var
orValue
=
cell
.
val
;
if
(
''
!=
orValue
)
isSkip
[
numSeries
]
=
false
;
var
value
=
parseFloat
(
orValue
);
if
(
!
isEn
&&
!
isNaN
(
value
))
var
val
=
curPoint
.
val
;
var
value
=
parseFloat
(
val
);
if
(
!
isNaN
(
value
))
{
if
(
value
>
max
)
{
min
=
value
;
max
=
value
;
isEn
=
true
;
}
if
(
!
isNaN
(
value
)
&&
value
>
max
)
max
=
value
;
if
(
!
isNaN
(
value
)
&&
value
<
min
)
if
(
value
<
min
)
{
min
=
value
;
if
(
isNaN
(
value
)
&&
orValue
==
''
&&
(((
this
.
calcProp
.
type
==
'
Line
'
)
&&
this
.
calcProp
.
type
==
'
normal
'
)))
}
}
if
(
isNaN
(
value
)
&&
val
==
''
&&
(((
t
.
calcProp
.
type
==
'
Line
'
)
&&
t
.
calcProp
.
type
==
'
normal
'
)))
{
value
=
''
;
}
...
...
@@ -1230,17 +1210,19 @@ CChartsDrawer.prototype =
value
=
0
;
}
if
(
t
his
.
calcProp
.
type
==
'
Pie
'
||
this
.
calcProp
.
type
==
"
DoughnutChart
"
)
arrValues
[
numSeries
][
n
]
=
Math
.
abs
(
value
);
else
arrValues
[
numSeries
][
n
]
=
value
;
if
(
t
.
calcProp
.
type
==
'
Pie
'
||
t
.
calcProp
.
type
==
"
DoughnutChart
"
)
{
value
=
Math
.
abs
(
value
);
}
arrValues
[
numSeries
][
n
]
=
value
;
n
++
;
}
numSeries
++
;
}
}
else
//point(scatter) chart
};
var
generateArrValuesScatter
=
function
()
{
var
yVal
;
var
xVal
;
...
...
@@ -1317,8 +1299,17 @@ CChartsDrawer.prototype =
}
}
this
.
calcProp
.
ymin
=
minY
;
this
.
calcProp
.
ymax
=
maxY
;
t
.
calcProp
.
ymin
=
minY
;
t
.
calcProp
.
ymax
=
maxY
;
};
if
(
this
.
calcProp
.
type
!=
'
Scatter
'
)
//берём данные из NumCache
{
generateArrValues
();
}
else
//point(scatter) chart
{
generateArrValuesScatter
();
}
this
.
calcProp
.
min
=
min
;
...
...
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