Commit 9c03628d authored by GoshaZotov's avatar GoshaZotov

change function _calculateData2

parent e7d5af3b
...@@ -1152,76 +1152,56 @@ CChartsDrawer.prototype = ...@@ -1152,76 +1152,56 @@ CChartsDrawer.prototype =
} }
}, },
_calculateData2: function(chart) { _calculateData2: function(chart)
var max = 0; {
var min = 0; var xNumCache, yNumCache, newArr, arrValues = [], max = 0, min = 0, minY = 0, maxY = 0;
var minY = 0;
var maxY = 0;
var xNumCache, yNumCache, newArr;
var series = chart.chart.plotArea.chart.series; var series = chart.chart.plotArea.chart.series;
if(this.calcProp.type != 'Scatter')//берём данные из NumCache var t = this;
{
var arrValues = []; var generateArrValues = function()
var isSkip = []; {
var skipSeries = [];
var isEn = false;
var isEnY = false;
var numSeries = 0; var numSeries = 0;
var curSeria; for(var l = 0; l < series.length; l++)
var isNumberVal = true;
for(var l = 0; l < series.length; ++l)
{ {
var firstCol = 0; var seria = series[l];
var firstRow = 0; var numCache = seria.val.numRef && seria.val.numRef.numCache ? seria.val.numRef.numCache : seria.val.numLit ? seria.val.numLit : null;
var pts = numCache ? numCache.pts : null;
curSeria = series[l].val.numRef && series[l].val.numRef.numCache ? series[l].val.numRef.numCache.pts : series[l].val.numLit ? series[l].val.numLit.pts : null; if( !pts || !pts.length || seria.isHidden == true)
{
skipSeries[l] = true;
if(series[l].isHidden == true)
continue;
if(!curSeria || !curSeria.length)
continue; continue;
}
skipSeries[l] = false;
arrValues[numSeries] = [];
isSkip[numSeries] = true;
var row = firstRow;
var n = 0; var n = 0;
for(var col = firstCol; col < curSeria.length; ++col) arrValues[numSeries] = [];
for(var col = 0; col < numCache.ptCount; col++)
{ {
if(!curSeria[col]) var curPoint = t.getIdxPoint(seria, col);
if(!curPoint)
{ {
curSeria[col] = {val:0}; curPoint = {val: 0};
} }
else if(curSeria[col].isHidden == true) else if(curPoint.isHidden == true)
{ {
continue; continue;
} }
var cell = curSeria[col]; var val = curPoint.val;
var value = parseFloat(val);
var orValue = cell.val; if(!isNaN(value))
if('' != orValue)
isSkip[numSeries] = false;
var value = parseFloat(orValue);
if(!isEn && !isNaN(value))
{ {
min = value; if(value > max)
max = value; {
isEn = true; max = value;
}
if(value < min)
{
min = value;
}
} }
if(!isNaN(value) && value > max)
max = value; if(isNaN(value) && val == '' && (((t.calcProp.type == 'Line' ) && t.calcProp.type == 'normal')))
if(!isNaN(value) && value < min)
min = value;
if(isNaN(value) && orValue == '' && (((this.calcProp.type == 'Line' ) && this.calcProp.type == 'normal')))
{ {
value = ''; value = '';
} }
...@@ -1230,17 +1210,19 @@ CChartsDrawer.prototype = ...@@ -1230,17 +1210,19 @@ CChartsDrawer.prototype =
value = 0; value = 0;
} }
if(this.calcProp.type == 'Pie' || this.calcProp.type == "DoughnutChart") if(t.calcProp.type == 'Pie' || t.calcProp.type == "DoughnutChart")
arrValues[numSeries][n] = Math.abs(value); {
else value = Math.abs(value);
arrValues[numSeries][n] = value; }
arrValues[numSeries][n] = value;
n++; n++;
} }
numSeries++; numSeries++;
} }
} };
else //point(scatter) chart
var generateArrValuesScatter = function()
{ {
var yVal; var yVal;
var xVal; var xVal;
...@@ -1317,8 +1299,17 @@ CChartsDrawer.prototype = ...@@ -1317,8 +1299,17 @@ CChartsDrawer.prototype =
} }
} }
this.calcProp.ymin = minY; t.calcProp.ymin = minY;
this.calcProp.ymax = maxY; t.calcProp.ymax = maxY;
};
if(this.calcProp.type != 'Scatter')//берём данные из NumCache
{
generateArrValues();
}
else //point(scatter) chart
{
generateArrValuesScatter();
} }
this.calcProp.min = min; this.calcProp.min = min;
......
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