Commit 72d111c5 authored by Alexander.Trofimov's avatar Alexander.Trofimov

comments calc stdDev

parent 2fb65060
......@@ -180,9 +180,11 @@
}
return res;
};
CConditionalFormattingRule.prototype.getAverage = function(val, average) {
CConditionalFormattingRule.prototype.getAverage = function(val, average, stdDev) {
var res = false;
// ToDo stdDev
/*if (this.stdDev) {
average += (this.aboveAverage ? 1 : -1) * this.stdDev + stdDev;
}*/
if (this.aboveAverage) {
res = val > average;
} else {
......@@ -191,6 +193,9 @@
res = res || (this.equalAverage && val == average);
return res;
};
CConditionalFormattingRule.prototype.hasStdDev = function() {
return null !== this.stdDev;
};
function CColorScale () {
this.aCFVOs = [];
......
......@@ -3612,9 +3612,20 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
}
tmp = sum / nc;
/*if (oRule.hasStdDev()) {
sum = 0;
for (cell = 0; cell < values.length; ++cell) {
value = values[cell];
if (null !== value.v) {
sum += (value.v - tmp) * (value.v - tmp);
}
}
sum = Math.sqrt(sum / (nc - 1));
}*/
for (cell = 0; cell < values.length; ++cell) {
value = values[cell];
value.c.setConditionalFormattingStyle((null !== value.v && oRule.getAverage(value.v, tmp)) ? oRule.dxf : null);
value.c.setConditionalFormattingStyle((null !== value.v && oRule.getAverage(value.v, tmp, sum)) ? oRule.dxf : null);
}
} else {
if (!oRule.dxf) {
......
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