Commit f4f93364 authored by GoshaZotov's avatar GoshaZotov

fix bug 33243

parent 97aa953d
...@@ -1563,12 +1563,20 @@ CChartsDrawer.prototype = ...@@ -1563,12 +1563,20 @@ CChartsDrawer.prototype =
var arrayValues = []; var arrayValues = [];
var stackedPerMax = null !== manualMax ? manualMax : 100; var stackedPerMax = null !== manualMax ? manualMax : 100;
if(this.calcProp.subType === 'stackedPer' && step > stackedPerMax)
{
stackedPerMax = step;
}
for(var i = 0; i < 20; i++) for(var i = 0; i < 20; i++)
{ {
if(this.calcProp.subType == 'stackedPer' && (minUnit + step * i) > stackedPerMax) if(this.calcProp.subType == 'stackedPer' && (minUnit + step * i) > stackedPerMax)
{
break; break;
}
arrayValues[i] = minUnit + step * i; arrayValues[i] = minUnit + step * i;
if(axisMax == 0 && axisMin < 0 && arrayValues[i] == axisMax) if(axisMax == 0 && axisMin < 0 && arrayValues[i] == axisMax)
{ {
break; break;
...@@ -1576,12 +1584,16 @@ CChartsDrawer.prototype = ...@@ -1576,12 +1584,16 @@ CChartsDrawer.prototype =
else if((manualMax != null && arrayValues[i] >= axisMax) || (manualMax == null && arrayValues[i] > axisMax)) else if((manualMax != null && arrayValues[i] >= axisMax) || (manualMax == null && arrayValues[i] > axisMax))
{ {
if(this.calcProp.subType == 'stackedPer') if(this.calcProp.subType == 'stackedPer')
{
arrayValues[i] = arrayValues[i] / 100; arrayValues[i] = arrayValues[i] / 100;
}
break; break;
} }
else if(this.calcProp.subType == 'stackedPer') else if(this.calcProp.subType == 'stackedPer')
{
arrayValues[i] = arrayValues[i] / 100; arrayValues[i] = arrayValues[i] / 100;
}
} }
/*if(this.calcProp.subType == 'stackedPer') /*if(this.calcProp.subType == 'stackedPer')
...@@ -1592,7 +1604,9 @@ CChartsDrawer.prototype = ...@@ -1592,7 +1604,9 @@ CChartsDrawer.prototype =
}*/ }*/
if(!arrayValues.length) if(!arrayValues.length)
{
arrayValues = [0.2, 0.4, 0.6, 0.8, 1, 1.2]; arrayValues = [0.2, 0.4, 0.6, 0.8, 1, 1.2];
}
return arrayValues; return arrayValues;
}, },
...@@ -2062,7 +2076,11 @@ CChartsDrawer.prototype = ...@@ -2062,7 +2076,11 @@ CChartsDrawer.prototype =
var diffVal; var diffVal;
var plotArea = this.cChartSpace.chart.plotArea; var plotArea = this.cChartSpace.chart.plotArea;
if(val < yPoints[0].val) if(!yPoints[1] && val === yPoints[0].val)
{
result = yPoints[0].pos;
}
else if(val < yPoints[0].val)
{ {
resPos = Math.abs(yPoints[1].pos - yPoints[0].pos); resPos = Math.abs(yPoints[1].pos - yPoints[0].pos);
resVal = yPoints[1].val - yPoints[0].val; resVal = yPoints[1].val - yPoints[0].val;
...@@ -2074,8 +2092,9 @@ CChartsDrawer.prototype = ...@@ -2074,8 +2092,9 @@ CChartsDrawer.prototype =
} }
else if(val > yPoints[yPoints.length - 1].val) else if(val > yPoints[yPoints.length - 1].val)
{ {
resPos = Math.abs(yPoints[1].pos - yPoints[0].pos); var test = yPoints[1] ? yPoints[1] : yPoints[0];
resVal = yPoints[1].val - yPoints[0].val; resPos = Math.abs(test.pos - yPoints[0].pos);
resVal = test.val - yPoints[0].val;
diffVal = Math.abs(yPoints[yPoints.length - 1].val - val); diffVal = Math.abs(yPoints[yPoints.length - 1].val - val);
if(plotArea.valAx.scaling.orientation == ORIENTATION_MIN_MAX) if(plotArea.valAx.scaling.orientation == ORIENTATION_MIN_MAX)
......
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