Commit a204c9b1 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

правка для диаграмм с накоплением

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55816 954022d7-b5bf-4e40-9824-e11837661b57
parent 4b320d8d
...@@ -3878,35 +3878,36 @@ drawBarChart.prototype = ...@@ -3878,35 +3878,36 @@ drawBarChart.prototype =
{ {
if(!this.summBarVal[j]) if(!this.summBarVal[j])
{ {
var tempVal; var curVal;
var temp = 0; var temp = 0;
var numCache; var idxPoint;
for(var k = 0; k < this.chartProp.series.length; k++) for(var k = 0; k < this.chartProp.series.length; k++)
{ {
numCache = this.chartProp.series[k].val.numRef ? this.chartProp.series[k].val.numRef.numCache : this.chartProp.series[k].val.numLit; idxPoint = this.cChartDrawer.getIdxPoint(this.chartProp.series[k], j);
tempVal = parseFloat(this.chartProp.series[k].val.numRef.numCache.pts[j].val); curVal = idxPoint ? parseFloat(idxPoint.val) : 0;
if(tempVal)
temp += Math.abs(tempVal); if(curVal)
} temp += Math.abs(curVal);
};
this.summBarVal[j] = temp; this.summBarVal[j] = temp;
} }
}, },
_getStackedValue: function(series, i, j, val) _getStackedValue: function(series, i, j, val)
{ {
var numCache, result = 0, curVal, idxPoint; var result = 0, curVal, idxPoint;
for(var nSer = 0; nSer <= i; nSer++) for(var k = 0; k <= i; k++)
{ {
numCache = series[nSer].val.numRef ? series[nSer].val.numRef.numCache.pts : series[nSer].val.numLit.pts; idxPoint = this.cChartDrawer.getIdxPoint(this.chartProp.series[k], j);
idxPoint = this.cChartDrawer.getIdxPoint(this.chartProp.series[nSer], j);
curVal = idxPoint ? idxPoint.val : 0; curVal = idxPoint ? idxPoint.val : 0;
if(idxPoint && val > 0 && curVal > 0) if(idxPoint && val > 0 && curVal > 0)
result += parseFloat(curVal); result += parseFloat(curVal);
else if(idxPoint && val < 0 && curVal < 0) else if(idxPoint && val < 0 && curVal < 0)
result += parseFloat(curVal); result += parseFloat(curVal);
}; };
return result; return result;
}, },
...@@ -4951,34 +4952,34 @@ drawHBarChart.prototype = ...@@ -4951,34 +4952,34 @@ drawHBarChart.prototype =
{ {
if(!this.summBarVal[j]) if(!this.summBarVal[j])
{ {
var tempVal; var curVal;
var temp = 0, numCache; var temp = 0, idxPoint;
for(var k = 0; k < this.chartProp.series.length; k++) for(var k = 0; k < this.chartProp.series.length; k++)
{ {
numCache = this.chartProp.series[k].val.numRef ? this.chartProp.series[k].val.numRef.numCache : this.chartProp.series[k].val.numLit; idxPoint = this.cChartDrawer.getIdxPoint(this.chartProp.series[k], j);
tempVal = parseFloat(this.chartProp.series[k].val.numRef.numCache.pts[j].val); curVal = idxPoint ? parseFloat(idxPoint.val) : 0;
if(tempVal)
temp += Math.abs(tempVal); if(curVal)
} temp += Math.abs(curVal);
};
this.summBarVal[j] = temp; this.summBarVal[j] = temp;
} };
}, },
_getStackedValue: function(series, i, j, val) _getStackedValue: function(series, i, j, val)
{ {
var numCache, result = 0, curVal, idxPoint; var result = 0, curVal, idxPoint;
for(var nSer = 0; nSer <= i; nSer++) for(var k = 0; k <= i; k++)
{ {
numCache = series[nSer].val.numRef ? series[nSer].val.numRef.numCache.pts : series[nSer].val.numLit.pts; idxPoint = this.cChartDrawer.getIdxPoint(series[k], j);
idxPoint = this.cChartDrawer.getIdxPoint(this.chartProp.series[nSer], j);
curVal = idxPoint ? idxPoint.val : 0; curVal = idxPoint ? idxPoint.val : 0;
if(idxPoint && val > 0 && curVal > 0) if(idxPoint && val > 0 && curVal > 0)
result += parseFloat(curVal); result += parseFloat(curVal);
else if(idxPoint && val < 0 && curVal < 0) else if(idxPoint && val < 0 && curVal < 0)
result += parseFloat(curVal); result += parseFloat(curVal);
}; };
return result; return result;
}, },
......
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