Commit 4df4bc3c 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@54987 954022d7-b5bf-4e40-9824-e11837661b57
parent 8934ea55
...@@ -11,12 +11,15 @@ function CChartsDrawer() ...@@ -11,12 +11,15 @@ function CChartsDrawer()
this.allAreaChart = null; this.allAreaChart = null;
this.gridChart = null; this.gridChart = null;
this.chart = null; this.chart = null;
this.cChartSpace = null;
} }
CChartsDrawer.prototype = CChartsDrawer.prototype =
{ {
reCalculate : function(chartSpace) reCalculate : function(chartSpace)
{ {
this.cChartSpace = chartSpace;
this.calcProp = {}; this.calcProp = {};
this._calculateProperties(chartSpace); this._calculateProperties(chartSpace);
...@@ -112,6 +115,8 @@ CChartsDrawer.prototype = ...@@ -112,6 +115,8 @@ CChartsDrawer.prototype =
draw : function(chartSpace, graphics) draw : function(chartSpace, graphics)
{ {
this.cChartSpace = chartSpace;
var cShapeDrawer = new CShapeDrawer(); var cShapeDrawer = new CShapeDrawer();
cShapeDrawer.Graphics = graphics; cShapeDrawer.Graphics = graphics;
this.calcProp.series = chartSpace.chart.plotArea.chart.series; this.calcProp.series = chartSpace.chart.plotArea.chart.series;
...@@ -1292,9 +1297,9 @@ CChartsDrawer.prototype = ...@@ -1292,9 +1297,9 @@ CChartsDrawer.prototype =
{ {
right += standartMargin / 2; right += standartMargin / 2;
if(chartSpace.chart.plotArea.valAx && chartSpace.chart.plotArea.valAx.title != null && !isHBar) if(chartSpace.chart.plotArea.valAx && chartSpace.chart.plotArea.valAx.title != null && !isHBar)
right += chartSpace.chart.plotArea.valAx.title.extX; left += chartSpace.chart.plotArea.valAx.title.extX;
else if(isHBar && chartSpace.chart.plotArea.catAx && chartSpace.chart.plotArea.catAx.title != null) else if(isHBar && chartSpace.chart.plotArea.catAx && chartSpace.chart.plotArea.catAx.title != null)
right += chartSpace.chart.plotArea.catAx.title.extX; left += chartSpace.chart.plotArea.catAx.title.extX;
} }
else else
right += standartMargin; right += standartMargin;
...@@ -1317,11 +1322,11 @@ CChartsDrawer.prototype = ...@@ -1317,11 +1322,11 @@ CChartsDrawer.prototype =
//****top***** //****top*****
if(top) if(top)
{ {
top += standartMargin / 2; top += standartMargin + standartMargin / 2;
if(chartSpace.chart.plotArea.catAx && chartSpace.chart.plotArea.catAx.title != null && !isHBar) if(chartSpace.chart.plotArea.catAx && chartSpace.chart.plotArea.catAx.title != null && !isHBar)
top += chartSpace.chart.plotArea.catAx.title.extY; bottom += chartSpace.chart.plotArea.catAx.title.extY;
else if(isHBar && chartSpace.chart.plotArea.valAx && chartSpace.chart.plotArea.valAx.title != null) else if(isHBar && chartSpace.chart.plotArea.valAx && chartSpace.chart.plotArea.valAx.title != null)
top += chartSpace.chart.plotArea.valAx.title.extY; bottom += chartSpace.chart.plotArea.valAx.title.extY;
if(chartSpace.chart.title !== null && !chartSpace.chart.title.overlay) if(chartSpace.chart.title !== null && !chartSpace.chart.title.overlay)
top += chartSpace.chart.title.extY; top += chartSpace.chart.title.extY;
...@@ -1505,7 +1510,10 @@ CChartsDrawer.prototype = ...@@ -1505,7 +1510,10 @@ CChartsDrawer.prototype =
rightUpPointX = catAx.labels.x; rightUpPointX = catAx.labels.x;
rightUpPointY = valAx.yPoints[valAx.yPoints.length - 1].pos; if(valAx.scaling.orientation == ORIENTATION_MIN_MAX)
rightUpPointY = valAx.yPoints[valAx.yPoints.length - 1].pos;
else
rightUpPointY = valAx.yPoints[0].pos;
...@@ -1518,7 +1526,7 @@ CChartsDrawer.prototype = ...@@ -1518,7 +1526,7 @@ CChartsDrawer.prototype =
} }
else if((valAx.labels.x + valAx.labels.extX) >= rightUpPointY)//правее крайней правой точки else if((valAx.labels.x + valAx.labels.extX) >= rightUpPointY)//правее крайней правой точки
{ {
right = valAx.labels.x + valAx.labels.extX - rightUpPointY; right = valAx.labels.extX;
} }
} }
...@@ -1547,16 +1555,29 @@ CChartsDrawer.prototype = ...@@ -1547,16 +1555,29 @@ CChartsDrawer.prototype =
var min = this.calcProp.min; var min = this.calcProp.min;
var max = this.calcProp.max; var max = this.calcProp.max;
var orientation = this.cChartSpace ? this.cChartSpace.chart.plotArea.valAx.scaling.orientation : ORIENTATION_MIN_MAX;
if(min >= 0 && max >= 0) if(min >= 0 && max >= 0)
{ {
numNull = 0; if(orientation == ORIENTATION_MIN_MAX)
numNull = 0;
else
{
numNull = this.calcProp.numhlines;
if(this.calcProp.type == "HBar")
numNull = this.calcProp.numvlines;
}
} }
else if(min <= 0 && max <= 0) else if(min <= 0 && max <= 0)
{ {
numNull = this.calcProp.numhlines; if(orientation == ORIENTATION_MIN_MAX)
if(this.calcProp.type == "HBar") {
numNull = this.calcProp.numvlines; numNull = this.calcProp.numhlines;
if(this.calcProp.type == "HBar")
numNull = this.calcProp.numvlines;
}
else
numNull = 0;
} }
else else
{ {
...@@ -2716,7 +2737,7 @@ CChartsDrawer.prototype = ...@@ -2716,7 +2737,7 @@ CChartsDrawer.prototype =
//находим шаг //находим шаг
if(isOx || 'HBar' == this.calcProp.type) if(isOx || 'HBar' == this.calcProp.type)
step = this._getStep(firstDegree.val + 1.5); step = this._getStep(firstDegree.val + (firstDegree.val / 10) * 3);
else else
step = this._getStep(firstDegree.val); step = this._getStep(firstDegree.val);
...@@ -2787,6 +2808,8 @@ CChartsDrawer.prototype = ...@@ -2787,6 +2808,8 @@ CChartsDrawer.prototype =
step = 5; step = 5;
else if(step > 5 && step <= 10) else if(step > 5 && step <= 10)
step = 10; step = 10;
else if(step > 10 && step <= 20)
step = 20;
return step; return step;
}, },
...@@ -3093,6 +3116,8 @@ CChartsDrawer.prototype = ...@@ -3093,6 +3116,8 @@ CChartsDrawer.prototype =
var resPos; var resPos;
var resVal; var resVal;
var diffVal; var diffVal;
var plotArea = this.cChartSpace.chart.plotArea;
if(val < yPoints[0].val) if(val < yPoints[0].val)
{ {
resPos = Math.abs(yPoints[1].pos - yPoints[0].pos); resPos = Math.abs(yPoints[1].pos - yPoints[0].pos);
...@@ -3123,7 +3148,12 @@ CChartsDrawer.prototype = ...@@ -3123,7 +3148,12 @@ CChartsDrawer.prototype =
resVal = yPoints[s + 1].val - yPoints[s].val; resVal = yPoints[s + 1].val - yPoints[s].val;
if(!isOx) if(!isOx)
result = - (resPos / resVal) * (Math.abs(val - yPoints[s].val)) + yPoints[s].pos; {
if(plotArea.valAx.scaling.orientation == ORIENTATION_MIN_MAX)
result = - (resPos / resVal) * (Math.abs(val - yPoints[s].val)) + yPoints[s].pos;
else
result = (resPos / resVal) * (Math.abs(val - yPoints[s].val)) + yPoints[s].pos;
}
else else
result = (resPos / resVal) * (Math.abs(val - yPoints[s].val)) + yPoints[s].pos; result = (resPos / resVal) * (Math.abs(val - yPoints[s].val)) + yPoints[s].pos;
...@@ -6467,7 +6497,7 @@ catAxisChart.prototype = ...@@ -6467,7 +6497,7 @@ catAxisChart.prototype =
var stepX = xPoints[1] ? Math.abs(xPoints[1].pos - xPoints[0].pos) : Math.abs(xPoints[0].pos - this.chartProp.chartGutter._bottom / this.chartProp.pxToMM); var stepX = xPoints[1] ? Math.abs(xPoints[1].pos - xPoints[0].pos) : Math.abs(xPoints[0].pos - this.chartProp.chartGutter._bottom / this.chartProp.pxToMM);
var minorStep = stepX / this.chartProp.numvMinorlines; var minorStep = stepX / this.chartProp.numvMinorlines;
var posY = this.chartSpace.chart.plotArea.catAx.posY; var posY = this.chartProp.nullPositionOX / this.chartProp.pxToMM;
var posX; var posX;
var posMinorX; var posMinorX;
for(var i = 0; i < xPoints.length; i++) for(var i = 0; i < xPoints.length; i++)
......
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