Commit 18b2fc2d authored by Sergey Luzyanin's avatar Sergey Luzyanin

Merge branch 'feature/sparklines' of https://github.com/ONLYOFFICE/sdkjs into feature/sparklines

parents 42418b3f 89927348
......@@ -4466,29 +4466,29 @@ function sparklineGroup() {
this.colorLow = null;
this.f = '??';
this.arrSparklines = [];
this.arrCachedSparklines = [];
this.arrCachedSparklines = [];
}
sparklineGroup.prototype.clearCached = function()
{
this.arrCachedSparklines.length = 0;
sparklineGroup.prototype.clearCached = function() {
this.arrCachedSparklines.length = 0;
};
sparklineGroup.prototype.addView = function(oSparklineView)
{
this.arrCachedSparklines.push(oSparklineView);
sparklineGroup.prototype.addView = function(oSparklineView) {
this.arrCachedSparklines.push(oSparklineView);
};
sparklineGroup.prototype.draw = function(oDrawingContext)
{
var graphics = new CGraphics();
graphics.init(oDrawingContext.ctx, oDrawingContext.getWidth(0), oDrawingContext.getHeight(0), oDrawingContext.getWidth(3), oDrawingContext.getHeight(3));
graphics.m_oFontManager = g_fontManager;
for(var i = 0; i < this.arrCachedSparklines.length; ++i)
{
this.arrCachedSparklines[i].draw(graphics);
}
sparklineGroup.prototype.draw = function(oDrawingContext) {
var graphics = new CGraphics();
graphics.init(oDrawingContext.ctx, oDrawingContext.getWidth(0), oDrawingContext.getHeight(0),
oDrawingContext.getWidth(3), oDrawingContext.getHeight(3));
graphics.m_oFontManager = g_fontManager;
for (var i = 0; i < this.arrCachedSparklines.length; ++i) {
this.arrCachedSparklines[i].draw(graphics);
}
};
sparklineGroup.prototype.updateCache = function(wsView)
{
wsView.objectRender.createSparklineViews(this);
sparklineGroup.prototype.updateCache = function(range) {
for (var i = 0; i < this.arrSparklines.length; ++i) {
if (range.intersectionSimple(this.arrSparklines[i].f)) {
this.arrCachedSparklines[i] = null;
}
}
};
/** @constructor */
function sparkline() {
......
......@@ -2458,7 +2458,7 @@
/** Рисует спарклайны */
WorksheetView.prototype._drawSparklines = function(drawingCtx, range, offsetX, offsetY) {
this.objectRender.drawSparkLineGroup(this.model.sparklineGroups, drawingCtx);
this.objectRender.drawSparkLineGroups(drawingCtx, this.model.sparklineGroups, range);
};
/** Рисует ячейки таблицы */
......
......@@ -2024,10 +2024,15 @@ function DrawingObjects() {
}
};
_this.drawSparkLineGroup = function(oSparkLineGroup, oDrawingContext)
_this.drawSparkLineGroups = function(oDrawingContext, oSparkLineGroups, range)
{
},
for(var i = 0; i < oSparkLineGroups.arrSparklineGroup.length; ++i) {
var oSparklineGroup = oSparkLineGroups.arrSparklineGroup[i];
oSparklineGroup.updateCache(range);
for(var j = 0; j < oSparklineGroup.arrSparklines.length; ++j) {
}
}
};
_this.rebuildChartGraphicObjects = function(data)
{
......
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