Commit acb854b3 authored by Sergey Luzyanin's avatar Sergey Luzyanin

отрисовка спарклайнов

parent 455f52d3
...@@ -2458,7 +2458,8 @@ ...@@ -2458,7 +2458,8 @@
/** Рисует спарклайны */ /** Рисует спарклайны */
WorksheetView.prototype._drawSparklines = function(drawingCtx, range, offsetX, offsetY) { WorksheetView.prototype._drawSparklines = function(drawingCtx, range, offsetX, offsetY) {
this.objectRender.drawSparkLineGroups(drawingCtx, this.model.sparklineGroups, range); var ctx = (undefined === drawingCtx) ? this.drawingCtx : drawingCtx;
this.objectRender.drawSparkLineGroups(ctx, this.model.sparklineGroups, range);
}; };
/** Рисует ячейки таблицы */ /** Рисует ячейки таблицы */
......
...@@ -2012,26 +2012,30 @@ function DrawingObjects() { ...@@ -2012,26 +2012,30 @@ function DrawingObjects() {
} }
}; };
_this.clearSparklineGroups = function(range) { _this.clearSparklineGroups = function(oSparklineGroups, range) {
for(var i = 0; i < oSparklineGroups.arrSparklineGroup.length; ++i) { for(var i = 0; i < oSparklineGroups.arrSparklineGroup.length; ++i) {
var oSparklineGroup = oSparklineGroups.arrSparklineGroup[i]; var oSparklineGroup = oSparklineGroups.arrSparklineGroup[i];
oSparklineGroup.updateCache(range); oSparklineGroup.updateCache(range);
} }
}; };
_this.drawSparklineGroups = function(oDrawingContext, oSparklineGroups, range) _this.drawSparkLineGroups = function(oDrawingContext, oSparklineGroups, range)
{ {
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 < oSparklineGroups.arrSparklineGroup.length; ++i) { for(var i = 0; i < oSparklineGroups.arrSparklineGroup.length; ++i) {
var oSparklineGroup = oSparklineGroups.arrSparklineGroup[i]; var oSparklineGroup = oSparklineGroups.arrSparklineGroup[i];
for(var j = 0; j < oSparklineGroup.arrSparklines.length; ++j) { for(var j = 0; j < oSparklineGroup.arrSparklines.length; ++j) {
if (!oSparklineGroup.arrSparklines[i].checkInRange(range)) {
continue;
}
if (!oSparklineGroup.arrCachedSparklines[j]) { if (!oSparklineGroup.arrCachedSparklines[j]) {
var oSparklineView = new CSparklineView(); var oSparklineView = new CSparklineView();
oSparklineView.initFromSparkline(oSparklineGroup.arrSparklines[j], oSparklineGroup, worksheet); oSparklineView.initFromSparkline(oSparklineGroup.arrSparklines[j], oSparklineGroup, worksheet);
oSparklineGroup.addView(oSparklineView); oSparklineGroup.addView(oSparklineView, j);
}
if (!oSparklineGroup.arrSparklines[j].checkInRange(range)) {
continue;
} }
// draw oSparklineGroup.arrCachedSparklines[j].draw(graphics);
} }
} }
}; };
......
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