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
Hide 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
...
@@ -3074,68 +3074,70 @@ function Woorksheet(wb, _index, sId){
...
@@ -3074,68 +3074,70 @@ function Woorksheet(wb, _index, sId){
this
.
oAllCol
=
null
;
this
.
oAllCol
=
null
;
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
(
to
.
r2
>=
oThis
.
nRowsCount
)
if
(
null
!=
to
)
{
oThis
.
nRowsCount
=
to
.
r2
+
1
;
if
(
to
.
r2
>=
oThis
.
nRowsCount
)
if
(
to
.
c2
>=
oThis
.
nColsCount
)
oThis
.
nRowsCount
=
to
.
r2
+
1
;
oThis
.
nColsCount
=
to
.
c2
+
1
;
if
(
to
.
c2
>=
oThis
.
nColsCount
)
}
oThis
.
nColsCount
=
to
.
c2
+
1
;
});
}
this
.
hyperlinkManager
=
new
RangeDataManager
(
function
(
data
,
from
,
to
,
oChangeParam
){
});
if
(
History
.
Is_On
()
&&
(
null
!=
from
||
null
!=
to
))
this
.
hyperlinkManager
=
new
RangeDataManager
(
function
(
data
,
from
,
to
,
oChangeParam
)
{
{
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
)
}
data
.
Ref
=
oThis
.
getRange3
(
to
.
r1
,
to
.
c1
,
to
.
r2
,
to
.
c2
);
if
(
null
!=
to
)
else
if
(
oChangeParam
&&
oChangeParam
.
removeStyle
&&
null
!=
data
.
Ref
)
data
.
Ref
=
oThis
.
getRange3
(
to
.
r1
,
to
.
c1
,
to
.
r2
,
to
.
c2
);
else
if
(
oChangeParam
&&
oChangeParam
.
removeStyle
&&
data
.
Ref
.
cleanFormat
();
null
!=
data
.
Ref
)
//расширяем границы
data
.
Ref
.
cleanFormat
();
if
(
null
!=
to
){
//расширяем границы
if
(
to
.
r2
>=
oThis
.
nRowsCount
)
if
(
null
!=
to
)
{
oThis
.
nRowsCount
=
to
.
r2
+
1
;
if
(
to
.
r2
>=
oThis
.
nRowsCount
)
if
(
to
.
c2
>=
oThis
.
nColsCount
)
oThis
.
nRowsCount
=
to
.
r2
+
1
;
oThis
.
nColsCount
=
to
.
c2
+
1
;
if
(
to
.
c2
>=
oThis
.
nColsCount
)
}
oThis
.
nColsCount
=
to
.
c2
+
1
;
});
}
this
.
hyperlinkManager
.
setDependenceManager
(
this
.
mergeManager
);
});
this
.
DrawingDocument
=
new
CDrawingDocument
();
this
.
hyperlinkManager
.
setDependenceManager
(
this
.
mergeManager
);
this
.
sheetViews
=
[];
this
.
DrawingDocument
=
new
CDrawingDocument
();
this
.
aConditionalFormatting
=
[];
this
.
sheetViews
=
[];
this
.
sheetPr
=
null
;
this
.
aConditionalFormatting
=
[];
this
.
aFormulaExt
=
null
;
this
.
sheetPr
=
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
.
oDrawingOjectsManager
=
new
DrawingObjectsManager
(
this
);
this
.
sparklineGroups
=
new
sparklineGroups
();
this
.
contentChanges
=
new
CContentChanges
();
this
.
oDrawingOjectsManager
=
new
DrawingObjectsManager
(
this
);
/*handlers*/
this
.
contentChanges
=
new
CContentChanges
();
this
.
handlers
=
null
;
/*handlers*/
this
.
handlers
=
null
;
}
}
Woorksheet
.
prototype
.
addContentChanges
=
function
(
changes
)
Woorksheet
.
prototype
.
addContentChanges
=
function
(
changes
)
...
...
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