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
30689de0
Commit
30689de0
authored
Dec 12, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
union ranges for sparklines
parent
d2d31572
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
15 deletions
+32
-15
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+32
-15
No files found.
cell/model/WorkbookElems.js
View file @
30689de0
...
@@ -5288,7 +5288,7 @@ CellArea.prototype = {
...
@@ -5288,7 +5288,7 @@ CellArea.prototype = {
}
}
return
bRemove
;
return
bRemove
;
};
};
sparklineGroup
.
prototype
.
getLocationRanges
=
function
()
{
sparklineGroup
.
prototype
.
getLocationRanges
=
function
(
onlySingle
)
{
var
result
=
new
AscCommonExcel
.
SelectionRange
();
var
result
=
new
AscCommonExcel
.
SelectionRange
();
this
.
arrSparklines
.
forEach
(
function
(
item
,
i
)
{
this
.
arrSparklines
.
forEach
(
function
(
item
,
i
)
{
if
(
0
===
i
)
{
if
(
0
===
i
)
{
...
@@ -5298,7 +5298,24 @@ CellArea.prototype = {
...
@@ -5298,7 +5298,24 @@ CellArea.prototype = {
result
.
getLast
().
assign2
(
item
.
sqref
);
result
.
getLast
().
assign2
(
item
.
sqref
);
}
}
});
});
return
result
.
getUnion
();
var
unionRange
=
result
.
getUnion
();
return
(
!
onlySingle
||
unionRange
.
isSingleRange
())
?
unionRange
:
result
;
};
sparklineGroup
.
prototype
.
getDataRanges
=
function
()
{
var
isUnion
=
true
;
var
sheet
=
this
.
worksheet
.
getName
();
var
result
=
new
AscCommonExcel
.
SelectionRange
();
this
.
arrSparklines
.
forEach
(
function
(
item
,
i
)
{
isUnion
=
isUnion
&&
sheet
===
item
.
_f
.
sheet
;
if
(
0
===
i
)
{
result
.
assign2
(
item
.
_f
);
}
else
{
result
.
addRange
();
result
.
getLast
().
assign2
(
item
.
_f
);
}
});
var
unionRange
=
isUnion
?
result
.
getUnion
()
:
result
;
return
unionRange
.
isSingleRange
()
?
unionRange
:
result
;
};
};
sparklineGroup
.
prototype
.
asc_getId
=
function
()
{
sparklineGroup
.
prototype
.
asc_getId
=
function
()
{
return
this
.
Id
;
return
this
.
Id
;
...
@@ -5376,21 +5393,21 @@ CellArea.prototype = {
...
@@ -5376,21 +5393,21 @@ CellArea.prototype = {
return
this
.
colorLow
?
Asc
.
colorObjToAscColor
(
this
.
colorLow
)
:
this
.
colorLow
;
return
this
.
colorLow
?
Asc
.
colorObjToAscColor
(
this
.
colorLow
)
:
this
.
colorLow
;
};
};
sparklineGroup
.
prototype
.
asc_getDataRanges
=
function
()
{
sparklineGroup
.
prototype
.
asc_getDataRanges
=
function
()
{
var
oDataRange
=
new
AscCommonExcel
.
SelectionRange
();
var
oLocationRange
=
new
AscCommonExcel
.
SelectionRange
();
//var bInit = false;
var
arrResultData
=
[];
var
arrResultData
=
[];
var
arrResultLocation
=
[];
var
arrResultLocation
=
[];
this
.
arrSparklines
.
forEach
(
function
(
item
)
{
var
oLocationRanges
=
this
.
getLocationRanges
(
true
);
/*if (bInit) {
var
oDataRanges
=
oLocationRanges
.
isSingleRange
()
&&
this
.
getDataRanges
();
if
(
oLocationRanges
.
isSingleRange
()
&&
oDataRanges
.
isSingleRange
())
{
for
(
var
i
=
0
;
i
<
oLocationRanges
.
ranges
.
length
;
++
i
)
{
arrResultData
.
push
(
oDataRanges
.
ranges
[
i
].
getName
());
arrResultLocation
.
push
(
oLocationRanges
.
ranges
[
i
].
getAbsName
());
}
}
else
{
}
else
{
bInit = true;
this
.
arrSparklines
.
forEach
(
function
(
item
)
{
oDataRange.assign2(item.sqref);
oLocationRange.assign2();
}*/
arrResultData
.
push
(
item
.
f
);
arrResultData
.
push
(
item
.
f
);
arrResultLocation
.
push
(
item
.
sqref
.
getAbsName
());
arrResultLocation
.
push
(
item
.
sqref
.
getAbsName
());
});
});
}
return
[
arrResultData
.
join
(
AscCommon
.
FormulaSeparators
.
functionArgumentSeparator
),
return
[
arrResultData
.
join
(
AscCommon
.
FormulaSeparators
.
functionArgumentSeparator
),
arrResultLocation
.
join
(
AscCommon
.
FormulaSeparators
.
functionArgumentSeparator
)];
arrResultLocation
.
join
(
AscCommon
.
FormulaSeparators
.
functionArgumentSeparator
)];
};
};
...
...
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