Commit e9368818 authored by Alexander.Trofimov's avatar Alexander.Trofimov

add draw sparklines to view

parent b36eab66
......@@ -3074,68 +3074,70 @@ function Woorksheet(wb, _index, sId){
this.oAllCol = null;
this.aComments = [];
this.aCommentsCoords = [];
var oThis = this;
this.mergeManager = new RangeDataManager(function(data, from, to){
if(History.Is_On() && (null != from || null != to))
{
if(null != from)
from = from.clone();
if(null != to)
to = to.clone();
var oHistoryRange = from;
if(null == oHistoryRange)
oHistoryRange = 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)
oThis.nRowsCount = to.r2 + 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))
{
if(null != from)
from = from.clone();
if(null != to)
to = to.clone();
var oHistoryRange = from;
if(null == oHistoryRange)
oHistoryRange = to;
var oHistoryData = null;
if(null == from || null == to)
oHistoryData = data.clone();
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);
else if (oChangeParam && oChangeParam.removeStyle && null != data.Ref)
data.Ref.cleanFormat();
//расширяем границы
if(null != to){
if(to.r2 >= oThis.nRowsCount)
oThis.nRowsCount = to.r2 + 1;
if(to.c2 >= oThis.nColsCount)
oThis.nColsCount = to.c2 + 1;
}
});
this.hyperlinkManager.setDependenceManager(this.mergeManager);
this.DrawingDocument = new CDrawingDocument();
this.sheetViews = [];
this.aConditionalFormatting = [];
this.sheetPr = null;
this.aFormulaExt = null;
this.autoFilters = asc.AutoFilters !== undefined ? new asc.AutoFilters(this) : null;
this.oDrawingOjectsManager = new DrawingObjectsManager(this);
this.contentChanges = new CContentChanges();
/*handlers*/
this.handlers = null;
var oThis = this;
this.mergeManager = new RangeDataManager(function(data, from, to) {
if (History.Is_On() && (null != from || null != to)) {
if (null != from) {
from = from.clone();
}
if (null != to)
to = to.clone();
var oHistoryRange = from;
if (null == oHistoryRange)
oHistoryRange = 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)
oThis.nRowsCount = to.r2 + 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)) {
if (null != from)
from = from.clone();
if (null != to)
to = to.clone();
var oHistoryRange = from;
if (null == oHistoryRange)
oHistoryRange = to;
var oHistoryData = null;
if (null == from || null == to)
oHistoryData = data.clone();
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); else if (oChangeParam && oChangeParam.removeStyle &&
null != data.Ref)
data.Ref.cleanFormat();
//расширяем границы
if (null != to) {
if (to.r2 >= oThis.nRowsCount)
oThis.nRowsCount = to.r2 + 1;
if (to.c2 >= oThis.nColsCount)
oThis.nColsCount = to.c2 + 1;
}
});
this.hyperlinkManager.setDependenceManager(this.mergeManager);
this.DrawingDocument = new CDrawingDocument();
this.sheetViews = [];
this.aConditionalFormatting = [];
this.sheetPr = null;
this.aFormulaExt = null;
this.autoFilters = asc.AutoFilters !== undefined ? new asc.AutoFilters(this) : null;
this.sparklineGroups = new sparklineGroups();
this.oDrawingOjectsManager = new DrawingObjectsManager(this);
this.contentChanges = new CContentChanges();
/*handlers*/
this.handlers = null;
}
Woorksheet.prototype.addContentChanges = function(changes)
......
......@@ -4406,9 +4406,11 @@ CellArea.prototype = {
}
};
/** @constructor */
function sparklineGroups() {
this.arrSparklineGroup = [];
}
/** @constructor */
function sparklineGroup() {
// attributes
this.manualMax = undefined;
......@@ -4442,17 +4444,14 @@ function sparklineGroup() {
this.arrSparklines = [];
this.arrCachedSparklines = [];
}
sparklineGroup.prototype.clearCached = function()
{
this.arrCachedSparklines.length = 0;
};
sparklineGroup.prototype.addView = function(oSparklineView)
{
this.arrCachedSparklines.push(oSparklineView);
};
sparklineGroup.prototype.draw = function(oDrawingContext)
{
var graphics = new CGraphics();
......@@ -4467,6 +4466,7 @@ sparklineGroup.prototype.updateCache = function(wsView)
{
wsView.objectRender.createSparklineViews(this);
};
/** @constructor */
function sparkline() {
this.sqref = '??'; // ToDo добавить значение по умолчанию
this.f = '??';
......
......@@ -2434,7 +2434,7 @@
/** Рисует спарклайны */
WorksheetView.prototype._drawSparklines = function(drawingCtx, range, offsetX, offsetY) {
this.objectRender.drawSparkLineGroup(this.model.sparklineGroups, drawingCtx);
};
/** Рисует ячейки таблицы */
......@@ -2455,6 +2455,7 @@
this._drawCellText(drawingCtx, mc.c1, mc.r1, range.c1, range.c2, offsetX, offsetY, true);
}
}
this._drawSparklines(drawingCtx, range, offsetX, offsetY);
return mergedCells;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment