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

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@54047 954022d7-b5bf-4e40-9824-e11837661b57
parent 0d69e6a1
...@@ -82,6 +82,24 @@ CChartsDrawer.prototype = ...@@ -82,6 +82,24 @@ CChartsDrawer.prototype =
this.chart.draw(this, cShapeDrawer, chartProp); this.chart.draw(this, cShapeDrawer, chartProp);
}, },
reCalculatePositionText : function(type, chartSpace, ser, val)
{
var pos;
switch ( type )
{
case "dlbl":
{
pos = this._calculatePositionDlbl(chartSpace, ser, val);
}
}
return {x: pos.x, y : pos.y};
},
_calculatePositionDlbl: function(chartSpace, ser, val)
{
this.chart._calculateDLbl(chartSpace, ser, val);
},
_calculateProperties: function(chartProp) _calculateProperties: function(chartProp)
{ {
this.calcProp.pxToMM = 1/chartProp.convertPixToMM(1); this.calcProp.pxToMM = 1/chartProp.convertPixToMM(1);
...@@ -2300,29 +2318,43 @@ drawLineChart.prototype = ...@@ -2300,29 +2318,43 @@ drawLineChart.prototype =
this.paths.series[i][n] = this._calculateLine(x, y, x1, y1); this.paths.series[i][n] = this._calculateLine(x, y, x1, y1);
//caclculate dataLablels //caclculate dataLablels
this._calculateDLbl(dataSeries[n - 1], x, y); /*posDlbl = this._calculateDLbl(dataSeries[n - 1], x, y);
dataSeries[n - 1].compiledDlb.setPosition(posDlbl.x, posDlbl.y);
if(n == dataSeries.length - 1) if(n == dataSeries.length - 1)
this._calculateDLbl(dataSeries[n], x1, y1); {
posDlbl = this._calculateDLbl(dataSeries[n], x1, y1);
dataSeries[n].compiledDlb.setPosition(posDlbl.x, posDlbl.y);
}*/
} }
} }
}, },
_calculateDLbl: function(point, x, y) _calculateDLbl: function(chartSpace, ser, val)
{ {
var point = this.chartProp.series[ser].val.numRef.numCache.pts[val];
var path;
if(ser == this.paths.series[ser].length - 1)
path = this.paths.series[ser][val].ArrPathCommand[1];
else
path = this.paths.series[ser][val].ArrPathCommand[0];
var x = path.x;
var y = path.y;
var pxToMm = this.chartProp.pxToMM; var pxToMm = this.chartProp.pxToMM;
var constMargin = 5 / pxToMm;
var width = point.compiledDlb.extX; var width = point.compiledDlb.extX;
var height = point.compiledDlb.extY; var height = point.compiledDlb.extY;
var centerX = x / pxToMm - width/2; var centerX = x - width/2;
var centerY = y / pxToMm - height/2; var centerY = y - height/2;
//TODO , //TODO ,
switch ( point.compiledDlb.dLblPos ) switch ( point.compiledDlb.dLblPos )
{ {
case DLBL_POS_B: case DLBL_POS_B:
{ {
centerY = centerY + height/2; centerY = centerY + height/2 + constMargin;
break; break;
} }
case DLBL_POS_BEST_FIT: case DLBL_POS_BEST_FIT:
...@@ -2346,7 +2378,7 @@ drawLineChart.prototype = ...@@ -2346,7 +2378,7 @@ drawLineChart.prototype =
} }
case DLBL_POS_L: case DLBL_POS_L:
{ {
centerX = centerX - height/2; centerX = centerX - height/2 - constMargin;
break; break;
} }
case DLBL_POS_OUT_END: case DLBL_POS_OUT_END:
...@@ -2356,17 +2388,16 @@ drawLineChart.prototype = ...@@ -2356,17 +2388,16 @@ drawLineChart.prototype =
} }
case DLBL_POS_R: case DLBL_POS_R:
{ {
centerX = centerX + height/2; centerX = centerX + height/2 + constMargin;
break; break;
} }
case DLBL_POS_T: case DLBL_POS_T:
{ {
centerY = centerY - height/2; centerY = centerY - height/2 - constMargin;
break; break;
} }
} }
return {x: centerX, y: centerY};
point.compiledDlb.setPosition(centerX, centerY);
}, },
_drawLines: function (isRedraw/*isSkip*/) _drawLines: function (isRedraw/*isSkip*/)
......
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