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
4004c3e3
Commit
4004c3e3
authored
Nov 25, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arrCachedSparklines -> oCacheView in sparkline
fix bug with clear all
parent
665f45a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
25 deletions
+27
-25
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+10
-9
common/Charts/DrawingObjects.js
common/Charts/DrawingObjects.js
+17
-16
No files found.
cell/model/WorkbookElems.js
View file @
4004c3e3
...
...
@@ -4717,7 +4717,6 @@ CellArea.prototype = {
this
.
f
=
null
;
this
.
arrSparklines
=
[];
this
.
arrCachedSparklines
=
{};
//for drawing preview
this
.
canvas
=
null
;
...
...
@@ -5187,21 +5186,23 @@ CellArea.prototype = {
return
res
;
};
sparklineGroup
.
prototype
.
addView
=
function
(
oSparklineView
,
index
)
{
this
.
arrCachedSparklines
[
index
]
=
oSparklineView
;
};
sparklineGroup
.
prototype
.
draw
=
function
(
oDrawingContext
)
{
var
oCacheView
;
var
graphics
=
new
AscCommon
.
CGraphics
();
graphics
.
init
(
oDrawingContext
.
ctx
,
oDrawingContext
.
getWidth
(
0
),
oDrawingContext
.
getHeight
(
0
),
oDrawingContext
.
getWidth
(
3
),
oDrawingContext
.
getHeight
(
3
));
graphics
.
m_oFontManager
=
AscCommon
.
g_fontManager
;
for
(
var
i
in
this
.
arrCachedSparklines
)
{
this
.
arrCachedSparklines
[
i
].
draw
(
graphics
);
for
(
var
i
=
0
;
i
<
this
.
arrSparklines
.
length
;
++
i
)
{
if
(
oCacheView
=
this
.
arrSparklines
[
i
].
oCacheView
)
{
oCacheView
.
draw
(
graphics
);
}
}
};
sparklineGroup
.
prototype
.
cleanCache
=
function
()
{
// ToDo clean only colors (for color scheme)
this
.
arrCachedSparklines
=
{};
for
(
var
i
=
0
;
i
<
this
.
arrSparklines
.
length
;
++
i
)
{
this
.
arrSparklines
[
i
].
oCacheView
=
null
;
}
};
sparklineGroup
.
prototype
.
updateCache
=
function
(
sheet
,
ranges
)
{
var
sparklineRange
;
...
...
@@ -5209,7 +5210,7 @@ CellArea.prototype = {
sparklineRange
=
this
.
arrSparklines
[
i
].
_f
;
for
(
var
j
=
0
;
j
<
ranges
.
length
;
++
j
)
{
if
(
sparklineRange
.
isIntersect
(
ranges
[
j
],
sheet
))
{
delete
this
.
arrCachedSparklines
[
i
]
;
this
.
arrSparklines
[
i
].
oChacheView
=
null
;
break
;
}
}
...
...
@@ -5227,7 +5228,6 @@ CellArea.prototype = {
for
(
var
i
=
0
;
i
<
this
.
arrSparklines
.
length
;
++
i
)
{
if
(
this
.
arrSparklines
[
i
].
checkInRange
(
range
))
{
this
.
arrSparklines
.
splice
(
i
,
1
);
delete
this
.
arrCachedSparklines
[
i
];
--
i
;
}
}
...
...
@@ -5536,6 +5536,7 @@ CellArea.prototype = {
//for preview
this
.
oCache
=
null
;
this
.
oCacheView
=
null
;
}
sparkline
.
prototype
.
clone
=
function
()
{
...
...
common/Charts/DrawingObjects.js
View file @
4004c3e3
...
...
@@ -2875,18 +2875,18 @@ function DrawingObjects() {
_this
.
checkSparklineGroupMinMaxVal
=
function
(
oSparklineGroup
)
{
var
maxVal
=
null
,
minVal
=
null
,
i
,
j
;
var
maxVal
=
null
,
minVal
=
null
,
i
,
j
,
sparkline
;
if
(
oSparklineGroup
.
type
!==
Asc
.
c_oAscSparklineType
.
Stacked
&&
(
Asc
.
c_oAscSparklineAxisMinMax
.
Group
===
oSparklineGroup
.
minAxisType
||
Asc
.
c_oAscSparklineAxisMinMax
.
Group
===
oSparklineGroup
.
maxAxisType
))
{
for
(
i
=
0
;
i
<
oSparklineGroup
.
arrSparklines
.
length
;
++
i
)
{
if
(
!
oSparklineGroup
.
arrCachedSparklines
[
i
])
{
var
oSparklineView
=
new
CSparklineView
();
oSparklineView
.
initFromSparkline
(
oSparklineGroup
.
arrSparklines
[
i
],
oSparklineGroup
,
worksheet
);
oSparklineGroup
.
addView
(
oSparklineView
,
i
);
sparkline
=
oSparklineGroup
.
arrSparklines
[
i
];
if
(
!
sparkline
.
oCacheView
)
{
sparkline
.
oCacheView
=
new
CSparklineView
(
);
sparkline
.
oCacheView
.
initFromSparkline
(
sparkline
,
oSparklineGroup
,
worksheet
);
}
var
aPoints
=
AscFormat
.
getPtsFromSeries
(
oSparklineGroup
.
arrCachedSparklines
[
i
]
.
chartSpace
.
chart
.
plotArea
.
charts
[
0
].
series
[
0
]);
var
aPoints
=
AscFormat
.
getPtsFromSeries
(
sparkline
.
oCacheView
.
chartSpace
.
chart
.
plotArea
.
charts
[
0
].
series
[
0
]);
for
(
j
=
0
;
j
<
aPoints
.
length
;
++
j
)
{
if
(
Asc
.
c_oAscSparklineAxisMinMax
.
Group
===
oSparklineGroup
.
maxAxisType
)
...
...
@@ -2923,7 +2923,7 @@ function DrawingObjects() {
{
for
(
i
=
0
;
i
<
oSparklineGroup
.
arrSparklines
.
length
;
++
i
)
{
oSparklineGroup
.
arrCachedSparklines
[
i
]
.
setMinMaxValAx
(
minVal
,
maxVal
,
oSparklineGroup
);
oSparklineGroup
.
arrSparklines
[
i
].
oCacheView
.
setMinMaxValAx
(
minVal
,
maxVal
,
oSparklineGroup
);
}
}
}
...
...
@@ -2932,7 +2932,7 @@ function DrawingObjects() {
_this
.
drawSparkLineGroups
=
function
(
oDrawingContext
,
aSparklineGroups
,
range
,
offsetX
,
offsetY
)
{
var
graphics
,
i
,
j
;
var
graphics
,
i
,
j
,
sparkline
;
if
(
oDrawingContext
instanceof
AscCommonExcel
.
CPdfPrinter
)
{
graphics
=
oDrawingContext
.
DocumentRenderer
;
...
...
@@ -2956,13 +2956,14 @@ function DrawingObjects() {
_this
.
checkSparklineGroupMinMaxVal
(
oSparklineGroup
);
}
for
(
j
=
0
;
j
<
oSparklineGroup
.
arrSparklines
.
length
;
++
j
)
{
if
(
!
oSparklineGroup
.
arrCachedSparklines
[
j
])
{
var
oSparklineView
=
new
CSparklineView
();
oSparklineView
.
initFromSparkline
(
oSparklineGroup
.
arrSparklines
[
j
],
oSparklineGroup
,
worksheet
);
oSparklineGroup
.
addView
(
oSparklineView
,
j
);
}
if
(
!
oSparklineGroup
.
arrSparklines
[
j
].
checkInRange
(
range
))
{
continue
;
sparkline
=
oSparklineGroup
.
arrSparklines
[
j
];
if
(
!
sparkline
.
checkInRange
(
range
))
{
continue
;
}
if
(
!
sparkline
.
oCacheView
)
{
sparkline
.
oCacheView
=
new
CSparklineView
();
sparkline
.
oCacheView
.
initFromSparkline
(
sparkline
,
oSparklineGroup
,
worksheet
);
}
if
(
oDrawingContext
instanceof
AscCommonExcel
.
CPdfPrinter
)
...
...
@@ -2975,7 +2976,7 @@ function DrawingObjects() {
graphics
.
SetBaseTransform
(
_baseTransform
);
}
oSparklineGroup
.
arrCachedSparklines
[
j
]
.
draw
(
graphics
,
_offX
,
_offY
);
sparkline
.
oCacheView
.
draw
(
graphics
,
_offX
,
_offY
);
if
(
oDrawingContext
instanceof
AscCommonExcel
.
CPdfPrinter
)
{
...
...
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