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 = {
...
@@ -4717,7 +4717,6 @@ CellArea.prototype = {
this
.
f
=
null
;
this
.
f
=
null
;
this
.
arrSparklines
=
[];
this
.
arrSparklines
=
[];
this
.
arrCachedSparklines
=
{};
//for drawing preview
//for drawing preview
this
.
canvas
=
null
;
this
.
canvas
=
null
;
...
@@ -5187,21 +5186,23 @@ CellArea.prototype = {
...
@@ -5187,21 +5186,23 @@ CellArea.prototype = {
return
res
;
return
res
;
};
};
sparklineGroup
.
prototype
.
addView
=
function
(
oSparklineView
,
index
)
{
this
.
arrCachedSparklines
[
index
]
=
oSparklineView
;
};
sparklineGroup
.
prototype
.
draw
=
function
(
oDrawingContext
)
{
sparklineGroup
.
prototype
.
draw
=
function
(
oDrawingContext
)
{
var
oCacheView
;
var
graphics
=
new
AscCommon
.
CGraphics
();
var
graphics
=
new
AscCommon
.
CGraphics
();
graphics
.
init
(
oDrawingContext
.
ctx
,
oDrawingContext
.
getWidth
(
0
),
oDrawingContext
.
getHeight
(
0
),
graphics
.
init
(
oDrawingContext
.
ctx
,
oDrawingContext
.
getWidth
(
0
),
oDrawingContext
.
getHeight
(
0
),
oDrawingContext
.
getWidth
(
3
),
oDrawingContext
.
getHeight
(
3
));
oDrawingContext
.
getWidth
(
3
),
oDrawingContext
.
getHeight
(
3
));
graphics
.
m_oFontManager
=
AscCommon
.
g_fontManager
;
graphics
.
m_oFontManager
=
AscCommon
.
g_fontManager
;
for
(
var
i
in
this
.
arrCachedSparklines
)
{
for
(
var
i
=
0
;
i
<
this
.
arrSparklines
.
length
;
++
i
)
{
this
.
arrCachedSparklines
[
i
].
draw
(
graphics
);
if
(
oCacheView
=
this
.
arrSparklines
[
i
].
oCacheView
)
{
oCacheView
.
draw
(
graphics
);
}
}
}
};
};
sparklineGroup
.
prototype
.
cleanCache
=
function
()
{
sparklineGroup
.
prototype
.
cleanCache
=
function
()
{
// ToDo clean only colors (for color scheme)
// 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
)
{
sparklineGroup
.
prototype
.
updateCache
=
function
(
sheet
,
ranges
)
{
var
sparklineRange
;
var
sparklineRange
;
...
@@ -5209,7 +5210,7 @@ CellArea.prototype = {
...
@@ -5209,7 +5210,7 @@ CellArea.prototype = {
sparklineRange
=
this
.
arrSparklines
[
i
].
_f
;
sparklineRange
=
this
.
arrSparklines
[
i
].
_f
;
for
(
var
j
=
0
;
j
<
ranges
.
length
;
++
j
)
{
for
(
var
j
=
0
;
j
<
ranges
.
length
;
++
j
)
{
if
(
sparklineRange
.
isIntersect
(
ranges
[
j
],
sheet
))
{
if
(
sparklineRange
.
isIntersect
(
ranges
[
j
],
sheet
))
{
delete
this
.
arrCachedSparklines
[
i
]
;
this
.
arrSparklines
[
i
].
oChacheView
=
null
;
break
;
break
;
}
}
}
}
...
@@ -5227,7 +5228,6 @@ CellArea.prototype = {
...
@@ -5227,7 +5228,6 @@ CellArea.prototype = {
for
(
var
i
=
0
;
i
<
this
.
arrSparklines
.
length
;
++
i
)
{
for
(
var
i
=
0
;
i
<
this
.
arrSparklines
.
length
;
++
i
)
{
if
(
this
.
arrSparklines
[
i
].
checkInRange
(
range
))
{
if
(
this
.
arrSparklines
[
i
].
checkInRange
(
range
))
{
this
.
arrSparklines
.
splice
(
i
,
1
);
this
.
arrSparklines
.
splice
(
i
,
1
);
delete
this
.
arrCachedSparklines
[
i
];
--
i
;
--
i
;
}
}
}
}
...
@@ -5536,6 +5536,7 @@ CellArea.prototype = {
...
@@ -5536,6 +5536,7 @@ CellArea.prototype = {
//for preview
//for preview
this
.
oCache
=
null
;
this
.
oCache
=
null
;
this
.
oCacheView
=
null
;
}
}
sparkline
.
prototype
.
clone
=
function
()
{
sparkline
.
prototype
.
clone
=
function
()
{
...
...
common/Charts/DrawingObjects.js
View file @
4004c3e3
...
@@ -2875,18 +2875,18 @@ function DrawingObjects() {
...
@@ -2875,18 +2875,18 @@ function DrawingObjects() {
_this
.
checkSparklineGroupMinMaxVal
=
function
(
oSparklineGroup
)
_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
&&
if
(
oSparklineGroup
.
type
!==
Asc
.
c_oAscSparklineType
.
Stacked
&&
(
Asc
.
c_oAscSparklineAxisMinMax
.
Group
===
oSparklineGroup
.
minAxisType
||
Asc
.
c_oAscSparklineAxisMinMax
.
Group
===
oSparklineGroup
.
maxAxisType
))
(
Asc
.
c_oAscSparklineAxisMinMax
.
Group
===
oSparklineGroup
.
minAxisType
||
Asc
.
c_oAscSparklineAxisMinMax
.
Group
===
oSparklineGroup
.
maxAxisType
))
{
{
for
(
i
=
0
;
i
<
oSparklineGroup
.
arrSparklines
.
length
;
++
i
)
for
(
i
=
0
;
i
<
oSparklineGroup
.
arrSparklines
.
length
;
++
i
)
{
{
if
(
!
oSparklineGroup
.
arrCachedSparklines
[
i
])
{
sparkline
=
oSparklineGroup
.
arrSparklines
[
i
];
var
oSparklineView
=
new
CSparklineView
();
if
(
!
sparkline
.
oCacheView
)
{
oSparklineView
.
initFromSparkline
(
oSparklineGroup
.
arrSparklines
[
i
],
oSparklineGroup
,
worksheet
);
sparkline
.
oCacheView
=
new
CSparklineView
(
);
oSparklineGroup
.
addView
(
oSparklineView
,
i
);
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
)
for
(
j
=
0
;
j
<
aPoints
.
length
;
++
j
)
{
{
if
(
Asc
.
c_oAscSparklineAxisMinMax
.
Group
===
oSparklineGroup
.
maxAxisType
)
if
(
Asc
.
c_oAscSparklineAxisMinMax
.
Group
===
oSparklineGroup
.
maxAxisType
)
...
@@ -2923,7 +2923,7 @@ function DrawingObjects() {
...
@@ -2923,7 +2923,7 @@ function DrawingObjects() {
{
{
for
(
i
=
0
;
i
<
oSparklineGroup
.
arrSparklines
.
length
;
++
i
)
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() {
...
@@ -2932,7 +2932,7 @@ function DrawingObjects() {
_this
.
drawSparkLineGroups
=
function
(
oDrawingContext
,
aSparklineGroups
,
range
,
offsetX
,
offsetY
)
_this
.
drawSparkLineGroups
=
function
(
oDrawingContext
,
aSparklineGroups
,
range
,
offsetX
,
offsetY
)
{
{
var
graphics
,
i
,
j
;
var
graphics
,
i
,
j
,
sparkline
;
if
(
oDrawingContext
instanceof
AscCommonExcel
.
CPdfPrinter
)
if
(
oDrawingContext
instanceof
AscCommonExcel
.
CPdfPrinter
)
{
{
graphics
=
oDrawingContext
.
DocumentRenderer
;
graphics
=
oDrawingContext
.
DocumentRenderer
;
...
@@ -2956,13 +2956,14 @@ function DrawingObjects() {
...
@@ -2956,13 +2956,14 @@ function DrawingObjects() {
_this
.
checkSparklineGroupMinMaxVal
(
oSparklineGroup
);
_this
.
checkSparklineGroupMinMaxVal
(
oSparklineGroup
);
}
}
for
(
j
=
0
;
j
<
oSparklineGroup
.
arrSparklines
.
length
;
++
j
)
{
for
(
j
=
0
;
j
<
oSparklineGroup
.
arrSparklines
.
length
;
++
j
)
{
if
(
!
oSparklineGroup
.
arrCachedSparklines
[
j
])
{
sparkline
=
oSparklineGroup
.
arrSparklines
[
j
];
var
oSparklineView
=
new
CSparklineView
();
if
(
!
sparkline
.
checkInRange
(
range
))
{
oSparklineView
.
initFromSparkline
(
oSparklineGroup
.
arrSparklines
[
j
],
oSparklineGroup
,
worksheet
);
continue
;
oSparklineGroup
.
addView
(
oSparklineView
,
j
);
}
}
if
(
!
oSparklineGroup
.
arrSparklines
[
j
].
checkInRange
(
range
))
{
if
(
!
sparkline
.
oCacheView
)
{
continue
;
sparkline
.
oCacheView
=
new
CSparklineView
();
sparkline
.
oCacheView
.
initFromSparkline
(
sparkline
,
oSparklineGroup
,
worksheet
);
}
}
if
(
oDrawingContext
instanceof
AscCommonExcel
.
CPdfPrinter
)
if
(
oDrawingContext
instanceof
AscCommonExcel
.
CPdfPrinter
)
...
@@ -2975,7 +2976,7 @@ function DrawingObjects() {
...
@@ -2975,7 +2976,7 @@ function DrawingObjects() {
graphics
.
SetBaseTransform
(
_baseTransform
);
graphics
.
SetBaseTransform
(
_baseTransform
);
}
}
oSparklineGroup
.
arrCachedSparklines
[
j
]
.
draw
(
graphics
,
_offX
,
_offY
);
sparkline
.
oCacheView
.
draw
(
graphics
,
_offX
,
_offY
);
if
(
oDrawingContext
instanceof
AscCommonExcel
.
CPdfPrinter
)
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