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
e9368818
Commit
e9368818
authored
Mar 31, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add draw sparklines to view
parent
b36eab66
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
66 deletions
+69
-66
cell/model/Workbook.js
cell/model/Workbook.js
+64
-62
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+3
-3
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+2
-1
No files found.
cell/model/Workbook.js
View file @
e9368818
...
@@ -3075,50 +3075,51 @@ function Woorksheet(wb, _index, sId){
...
@@ -3075,50 +3075,51 @@ function Woorksheet(wb, _index, sId){
this
.
aComments
=
[];
this
.
aComments
=
[];
this
.
aCommentsCoords
=
[];
this
.
aCommentsCoords
=
[];
var
oThis
=
this
;
var
oThis
=
this
;
this
.
mergeManager
=
new
RangeDataManager
(
function
(
data
,
from
,
to
){
this
.
mergeManager
=
new
RangeDataManager
(
function
(
data
,
from
,
to
)
{
if
(
History
.
Is_On
()
&&
(
null
!=
from
||
null
!=
to
))
if
(
History
.
Is_On
()
&&
(
null
!=
from
||
null
!=
to
))
{
{
if
(
null
!=
from
)
{
if
(
null
!=
from
)
from
=
from
.
clone
();
from
=
from
.
clone
();
if
(
null
!=
to
)
}
if
(
null
!=
to
)
to
=
to
.
clone
();
to
=
to
.
clone
();
var
oHistoryRange
=
from
;
var
oHistoryRange
=
from
;
if
(
null
==
oHistoryRange
)
if
(
null
==
oHistoryRange
)
oHistoryRange
=
to
;
oHistoryRange
=
to
;
History
.
Add
(
g_oUndoRedoWorksheet
,
historyitem_Worksheet_ChangeMerge
,
oThis
.
getId
(),
oHistoryRange
,
new
UndoRedoData_FromTo
(
new
UndoRedoData_BBox
(
from
),
new
UndoRedoData_BBox
(
to
)));
History
.
Add
(
g_oUndoRedoWorksheet
,
historyitem_Worksheet_ChangeMerge
,
oThis
.
getId
(),
oHistoryRange
,
new
UndoRedoData_FromTo
(
new
UndoRedoData_BBox
(
from
),
new
UndoRedoData_BBox
(
to
)));
}
}
//расширяем границы
//расширяем границы
if
(
null
!=
to
)
{
if
(
null
!=
to
)
{
if
(
to
.
r2
>=
oThis
.
nRowsCount
)
if
(
to
.
r2
>=
oThis
.
nRowsCount
)
oThis
.
nRowsCount
=
to
.
r2
+
1
;
oThis
.
nRowsCount
=
to
.
r2
+
1
;
if
(
to
.
c2
>=
oThis
.
nColsCount
)
if
(
to
.
c2
>=
oThis
.
nColsCount
)
oThis
.
nColsCount
=
to
.
c2
+
1
;
oThis
.
nColsCount
=
to
.
c2
+
1
;
}
}
});
});
this
.
hyperlinkManager
=
new
RangeDataManager
(
function
(
data
,
from
,
to
,
oChangeParam
){
this
.
hyperlinkManager
=
new
RangeDataManager
(
function
(
data
,
from
,
to
,
oChangeParam
)
{
if
(
History
.
Is_On
()
&&
(
null
!=
from
||
null
!=
to
))
if
(
History
.
Is_On
()
&&
(
null
!=
from
||
null
!=
to
))
{
{
if
(
null
!=
from
)
if
(
null
!=
from
)
from
=
from
.
clone
();
from
=
from
.
clone
();
if
(
null
!=
to
)
if
(
null
!=
to
)
to
=
to
.
clone
();
to
=
to
.
clone
();
var
oHistoryRange
=
from
;
var
oHistoryRange
=
from
;
if
(
null
==
oHistoryRange
)
if
(
null
==
oHistoryRange
)
oHistoryRange
=
to
;
oHistoryRange
=
to
;
var
oHistoryData
=
null
;
var
oHistoryData
=
null
;
if
(
null
==
from
||
null
==
to
)
if
(
null
==
from
||
null
==
to
)
oHistoryData
=
data
.
clone
();
oHistoryData
=
data
.
clone
();
History
.
Add
(
g_oUndoRedoWorksheet
,
historyitem_Worksheet_ChangeHyperlink
,
oThis
.
getId
(),
oHistoryRange
,
new
UndoRedoData_FromToHyperlink
(
from
,
to
,
oHistoryData
));
History
.
Add
(
g_oUndoRedoWorksheet
,
historyitem_Worksheet_ChangeHyperlink
,
oThis
.
getId
(),
oHistoryRange
,
new
UndoRedoData_FromToHyperlink
(
from
,
to
,
oHistoryData
));
}
}
if
(
null
!=
to
)
if
(
null
!=
to
)
data
.
Ref
=
oThis
.
getRange3
(
to
.
r1
,
to
.
c1
,
to
.
r2
,
to
.
c2
);
data
.
Ref
=
oThis
.
getRange3
(
to
.
r1
,
to
.
c1
,
to
.
r2
,
to
.
c2
);
else
if
(
oChangeParam
&&
oChangeParam
.
removeStyle
&&
else
if
(
oChangeParam
&&
oChangeParam
.
removeStyle
&&
null
!=
data
.
Ref
)
null
!=
data
.
Ref
)
data
.
Ref
.
cleanFormat
();
data
.
Ref
.
cleanFormat
();
//расширяем границы
//расширяем границы
if
(
null
!=
to
)
{
if
(
null
!=
to
)
{
if
(
to
.
r2
>=
oThis
.
nRowsCount
)
if
(
to
.
r2
>=
oThis
.
nRowsCount
)
oThis
.
nRowsCount
=
to
.
r2
+
1
;
oThis
.
nRowsCount
=
to
.
r2
+
1
;
if
(
to
.
c2
>=
oThis
.
nColsCount
)
if
(
to
.
c2
>=
oThis
.
nColsCount
)
oThis
.
nColsCount
=
to
.
c2
+
1
;
oThis
.
nColsCount
=
to
.
c2
+
1
;
}
}
});
});
...
@@ -3130,6 +3131,7 @@ function Woorksheet(wb, _index, sId){
...
@@ -3130,6 +3131,7 @@ function Woorksheet(wb, _index, sId){
this
.
aFormulaExt
=
null
;
this
.
aFormulaExt
=
null
;
this
.
autoFilters
=
asc
.
AutoFilters
!==
undefined
?
new
asc
.
AutoFilters
(
this
)
:
null
;
this
.
autoFilters
=
asc
.
AutoFilters
!==
undefined
?
new
asc
.
AutoFilters
(
this
)
:
null
;
this
.
sparklineGroups
=
new
sparklineGroups
();
this
.
oDrawingOjectsManager
=
new
DrawingObjectsManager
(
this
);
this
.
oDrawingOjectsManager
=
new
DrawingObjectsManager
(
this
);
this
.
contentChanges
=
new
CContentChanges
();
this
.
contentChanges
=
new
CContentChanges
();
...
...
cell/model/WorkbookElems.js
View file @
e9368818
...
@@ -4406,9 +4406,11 @@ CellArea.prototype = {
...
@@ -4406,9 +4406,11 @@ CellArea.prototype = {
}
}
};
};
/** @constructor */
function
sparklineGroups
()
{
function
sparklineGroups
()
{
this
.
arrSparklineGroup
=
[];
this
.
arrSparklineGroup
=
[];
}
}
/** @constructor */
function
sparklineGroup
()
{
function
sparklineGroup
()
{
// attributes
// attributes
this
.
manualMax
=
undefined
;
this
.
manualMax
=
undefined
;
...
@@ -4442,17 +4444,14 @@ function sparklineGroup() {
...
@@ -4442,17 +4444,14 @@ function sparklineGroup() {
this
.
arrSparklines
=
[];
this
.
arrSparklines
=
[];
this
.
arrCachedSparklines
=
[];
this
.
arrCachedSparklines
=
[];
}
}
sparklineGroup
.
prototype
.
clearCached
=
function
()
sparklineGroup
.
prototype
.
clearCached
=
function
()
{
{
this
.
arrCachedSparklines
.
length
=
0
;
this
.
arrCachedSparklines
.
length
=
0
;
};
};
sparklineGroup
.
prototype
.
addView
=
function
(
oSparklineView
)
sparklineGroup
.
prototype
.
addView
=
function
(
oSparklineView
)
{
{
this
.
arrCachedSparklines
.
push
(
oSparklineView
);
this
.
arrCachedSparklines
.
push
(
oSparklineView
);
};
};
sparklineGroup
.
prototype
.
draw
=
function
(
oDrawingContext
)
sparklineGroup
.
prototype
.
draw
=
function
(
oDrawingContext
)
{
{
var
graphics
=
new
CGraphics
();
var
graphics
=
new
CGraphics
();
...
@@ -4467,6 +4466,7 @@ sparklineGroup.prototype.updateCache = function(wsView)
...
@@ -4467,6 +4466,7 @@ sparklineGroup.prototype.updateCache = function(wsView)
{
{
wsView
.
objectRender
.
createSparklineViews
(
this
);
wsView
.
objectRender
.
createSparklineViews
(
this
);
};
};
/** @constructor */
function
sparkline
()
{
function
sparkline
()
{
this
.
sqref
=
'
??
'
;
// ToDo добавить значение по умолчанию
this
.
sqref
=
'
??
'
;
// ToDo добавить значение по умолчанию
this
.
f
=
'
??
'
;
this
.
f
=
'
??
'
;
...
...
cell/view/WorksheetView.js
View file @
e9368818
...
@@ -2434,7 +2434,7 @@
...
@@ -2434,7 +2434,7 @@
/** Рисует спарклайны */
/** Рисует спарклайны */
WorksheetView
.
prototype
.
_drawSparklines
=
function
(
drawingCtx
,
range
,
offsetX
,
offsetY
)
{
WorksheetView
.
prototype
.
_drawSparklines
=
function
(
drawingCtx
,
range
,
offsetX
,
offsetY
)
{
this
.
objectRender
.
drawSparkLineGroup
(
this
.
model
.
sparklineGroups
,
drawingCtx
);
};
};
/** Рисует ячейки таблицы */
/** Рисует ячейки таблицы */
...
@@ -2455,6 +2455,7 @@
...
@@ -2455,6 +2455,7 @@
this
.
_drawCellText
(
drawingCtx
,
mc
.
c1
,
mc
.
r1
,
range
.
c1
,
range
.
c2
,
offsetX
,
offsetY
,
true
);
this
.
_drawCellText
(
drawingCtx
,
mc
.
c1
,
mc
.
r1
,
range
.
c1
,
range
.
c2
,
offsetX
,
offsetY
,
true
);
}
}
}
}
this
.
_drawSparklines
(
drawingCtx
,
range
,
offsetX
,
offsetY
);
return
mergedCells
;
return
mergedCells
;
};
};
...
...
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