Commit 7aec60c2 authored by Alexander.Trofimov's avatar Alexander.Trofimov

add sparklineInfo to asc_onSelectionChanged

parent 4124f8bf
......@@ -5694,6 +5694,14 @@ Woorksheet.prototype.updateSparklineCache = function(sheet, ranges) {
this.aSparklineGroups[i].updateCache(sheet, ranges);
}
};
Woorksheet.prototype.getSparklineGroup = function(c, r) {
for (var i = 0; i < this.aSparklineGroups.length; ++i) {
if (-1 !== this.aSparklineGroups[i].contains(c, r)) {
return this.aSparklineGroups[i];
}
}
return null;
};
//-------------------------------------------------------------------------------------------------
/**
* @constructor
......
......@@ -4553,8 +4553,8 @@ CellArea.prototype = {
}
};
/** @constructor */
function sparklineGroup() {
/** @constructor */
function sparklineGroup() {
// attributes
this.manualMax = undefined;
this.manualMin = undefined;
......@@ -4586,8 +4586,9 @@ function sparklineGroup() {
this.f = null;
this.arrSparklines = [];
this.arrCachedSparklines = [];
}
sparklineGroup.prototype.clone = function() {
}
sparklineGroup.prototype.clone = function () {
var res = new sparklineGroup();
res.manualMax = this.manualMax;
res.manualMin = this.manualMin;
......@@ -4621,11 +4622,11 @@ sparklineGroup.prototype.clone = function() {
res.arrSparklines.push(this.arrSparklines[i].clone());
}
return res;
};
sparklineGroup.prototype.addView = function(oSparklineView, index) {
};
sparklineGroup.prototype.addView = function (oSparklineView, index) {
this.arrCachedSparklines[index] = oSparklineView;
};
sparklineGroup.prototype.draw = function(oDrawingContext) {
};
sparklineGroup.prototype.draw = function (oDrawingContext) {
var graphics = new AscCommon.CGraphics();
graphics.init(oDrawingContext.ctx, oDrawingContext.getWidth(0), oDrawingContext.getHeight(0),
oDrawingContext.getWidth(3), oDrawingContext.getHeight(3));
......@@ -4633,12 +4634,12 @@ sparklineGroup.prototype.draw = function(oDrawingContext) {
for (var i = 0; i < this.arrCachedSparklines.length; ++i) {
this.arrCachedSparklines[i].draw(graphics);
}
};
sparklineGroup.prototype.cleanCache = function() {
};
sparklineGroup.prototype.cleanCache = function () {
// ToDo clean only colors (for color scheme)
this.arrCachedSparklines = [];
};
sparklineGroup.prototype.updateCache = function(sheet, ranges) {
};
sparklineGroup.prototype.updateCache = function (sheet, ranges) {
var sparklineRange;
for (var i = 0; i < this.arrSparklines.length; ++i) {
sparklineRange = this.arrSparklines[i]._f;
......@@ -4649,14 +4650,23 @@ sparklineGroup.prototype.updateCache = function(sheet, ranges) {
}
}
}
};
/** @constructor */
function sparkline() {
};
sparklineGroup.prototype.contains = function (c, r) {
for (var j = 0; j < this.arrSparklines.length; ++j) {
if (oSparklineGroup.arrSparklines[j].contains(c, r)) {
return j;
}
}
return -1;
};
/** @constructor */
function sparkline() {
this.sqref = null;
this.f = null;
this._f = null;
}
sparkline.prototype.clone = function() {
}
sparkline.prototype.clone = function () {
var res = new sparkline();
res.sqref = this.sqref ? this.sqref.clone() : null;
......@@ -4664,17 +4674,20 @@ sparkline.prototype.clone = function() {
res._f = this._f ? this._f.clone() : null;
return res;
};
sparkline.prototype.setSqref = function(sqref) {
};
sparkline.prototype.setSqref = function (sqref) {
this.sqref = AscCommonExcel.g_oRangeCache.getAscRange(sqref);
};
sparkline.prototype.setF = function(f) {
};
sparkline.prototype.setF = function (f) {
this.f = f;
this._f = AscCommonExcel.g_oRangeCache.getRange3D(this.f);
};
sparkline.prototype.checkInRange = function(range) {
};
sparkline.prototype.checkInRange = function (range) {
return this.sqref ? range.isIntersect(this.sqref) : false;
};
};
sparkline.prototype.contains = function (c, r) {
return this.sqref ? range.contains(c, r) : false;
};
// For Auto Filters
/** @constructor */
......
......@@ -7108,6 +7108,8 @@
}
}
cell_info.sparklineInfo = this.model.getSparklineGroup(c1, r1);
return cell_info;
};
......
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