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
655c0e4d
Commit
655c0e4d
authored
May 13, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update conditional formatting
parent
e9c672ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
24 deletions
+23
-24
cell/model/Workbook.js
cell/model/Workbook.js
+23
-24
No files found.
cell/model/Workbook.js
View file @
655c0e4d
...
@@ -3477,9 +3477,7 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
...
@@ -3477,9 +3477,7 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
var
aCFs
=
this
.
aConditionalFormatting
;
var
aCFs
=
this
.
aConditionalFormatting
;
var
aRules
,
oRule
;
var
aRules
,
oRule
;
var
oRuleElement
=
null
;
var
oRuleElement
=
null
;
var
min
=
Number
.
MAX_VALUE
;
var
aValues
=
[],
aCells
=
[];
var
max
=
-
Number
.
MAX_VALUE
;
var
arrayCells
=
[];
var
tmp
,
i
,
j
,
cell
,
sqref
;
var
tmp
,
i
,
j
,
cell
,
sqref
;
for
(
i
=
0
;
i
<
aCFs
.
length
;
++
i
)
{
for
(
i
=
0
;
i
<
aCFs
.
length
;
++
i
)
{
sqref
=
aCFs
[
i
].
sqref
;
sqref
=
aCFs
[
i
].
sqref
;
...
@@ -3491,6 +3489,18 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
...
@@ -3491,6 +3489,18 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
aRules
=
aCFs
[
i
].
aRules
;
aRules
=
aCFs
[
i
].
aRules
;
for
(
j
=
0
;
j
<
aRules
.
length
;
++
j
)
{
for
(
j
=
0
;
j
<
aRules
.
length
;
++
j
)
{
oRule
=
aRules
[
j
];
oRule
=
aRules
[
j
];
this
.
getRange3
(
sqref
.
r1
,
sqref
.
c1
,
sqref
.
r2
,
sqref
.
c2
).
_setPropertyNoEmpty
(
null
,
null
,
function
(
c
)
{
if
(
CellValueType
.
Number
===
c
.
getType
()
&&
false
===
c
.
isEmptyTextString
())
{
tmp
=
parseFloat
(
c
.
getValueWithoutFormat
());
if
(
isNaN
(
tmp
))
{
return
;
}
aCells
.
push
(
c
);
aValues
.
push
(
tmp
);
}
});
// ToDo aboveAverage, beginsWith, cellIs, containsBlanks, containsErrors,
// ToDo aboveAverage, beginsWith, cellIs, containsBlanks, containsErrors,
// ToDo containsText, dataBar, duplicateValues, endsWith, expression, iconSet, notContainsBlanks,
// ToDo containsText, dataBar, duplicateValues, endsWith, expression, iconSet, notContainsBlanks,
// ToDo notContainsErrors, notContainsText, timePeriod, top10, uniqueValues (page 2679)
// ToDo notContainsErrors, notContainsText, timePeriod, top10, uniqueValues (page 2679)
...
@@ -3504,36 +3514,25 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
...
@@ -3504,36 +3514,25 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
break
;
break
;
}
}
this
.
getRange3
(
sqref
.
r1
,
sqref
.
c1
,
sqref
.
r2
,
sqref
.
c2
).
_setPropertyNoEmpty
(
null
,
null
,
function
(
c
)
{
if
(
CellValueType
.
Number
===
c
.
getType
()
&&
false
===
c
.
isEmptyTextString
())
{
tmp
=
parseFloat
(
c
.
getValueWithoutFormat
());
if
(
isNaN
(
tmp
))
{
return
;
}
arrayCells
.
push
({
cell
:
c
,
val
:
tmp
});
min
=
Math
.
min
(
min
,
tmp
);
max
=
Math
.
max
(
max
,
tmp
);
}
});
// ToDo CFVO Type (formula, max, min, num, percent, percentile) (page 2681)
// ToDo CFVO Type (formula, max, min, num, percent, percentile) (page 2681)
// ToDo support 3 colors in rule
// ToDo support 3 colors in rule
if
(
0
<
a
rray
Cells
.
length
&&
2
===
oRuleElement
.
aColors
.
length
)
{
if
(
0
<
aCells
.
length
&&
2
===
oRuleElement
.
aColors
.
length
)
{
oGradient
=
new
AscCommonExcel
.
CGradient
(
oRuleElement
.
aColors
[
0
],
oRuleElement
.
aColors
[
1
]);
oGradient
=
new
AscCommonExcel
.
CGradient
(
oRuleElement
.
aColors
[
0
],
oRuleElement
.
aColors
[
1
]);
oGradient
.
init
(
min
,
max
);
oGradient
.
init
(
Math
.
min
.
apply
(
Math
,
aValues
),
Math
.
max
.
apply
(
Math
,
aValues
)
);
for
(
cell
=
0
;
cell
<
a
rray
Cells
.
length
;
++
cell
)
{
for
(
cell
=
0
;
cell
<
aCells
.
length
;
++
cell
)
{
var
dxf
=
new
AscCommonExcel
.
CellXfs
();
var
dxf
=
new
AscCommonExcel
.
CellXfs
();
dxf
.
fill
=
new
AscCommonExcel
.
Fill
({
bg
:
oGradient
.
calculateColor
(
a
rrayCells
[
cell
].
val
)});
dxf
.
fill
=
new
AscCommonExcel
.
Fill
({
bg
:
oGradient
.
calculateColor
(
a
Values
[
cell
]
)});
a
rrayCells
[
cell
].
cell
.
setConditionalFormattingStyle
(
dxf
);
a
Cells
[
cell
]
.
setConditionalFormattingStyle
(
dxf
);
}
}
}
}
break
;
arrayCells
.
length
=
0
;
case
Asc
.
ECfType
.
uniqueValues
:
min
=
Number
.
MAX_VALUE
;
max
=
-
Number
.
MAX_VALUE
;
break
;
break
;
}
}
aCells
.
length
=
0
;
aValues
.
length
=
0
;
}
}
}
}
}
}
...
...
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