Commit f8046906 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@54128 954022d7-b5bf-4e40-9824-e11837661b57
parent f41d01f1
......@@ -159,7 +159,8 @@ CChartsDrawer.prototype =
_calculateProperties: function(chartProp)
{
this.preCalculateData(chartProp);
if(!this.calcProp.scale)
this.preCalculateData(chartProp);
//считаем маргины
this._calculateMarginsChart(chartProp);
......@@ -2279,17 +2280,8 @@ drawBarChart.prototype =
var centerX, centerY;
//TODO высчитать позиции, как в екселе
switch ( point.compiledDlb.dLblPos )
switch ( DLBL_POS_IN_END )
{
case DLBL_POS_B:
{
centerX = x + w/2 - width/2;
centerY = y;
if(point.val > 0)
centerY = y - height;
break;
}
case DLBL_POS_BEST_FIT:
{
break;
......@@ -2302,36 +2294,39 @@ drawBarChart.prototype =
}
case DLBL_POS_IN_BASE:
{
//TODO высчитать позиции, как в екселе
centerX = x + w/2 - width/2;
centerY = y - h/2 - height/2;
centerY = y;
if(point.val > 0)
centerY = y - height;
break;
}
case DLBL_POS_IN_END:
{
break;
}
case DLBL_POS_L:
{
centerX = x + w/2 - width/2;
centerY = y - h;
if(point.val < 0)
centerY = centerY - height;
break;
}
case DLBL_POS_OUT_END:
{
break;
}
case DLBL_POS_R:
{
break;
}
case DLBL_POS_T:
{
centerX = x + w/2 - width/2;
centerY = y - h;
centerY = y - h - height;
if(point.val < 0)
centerY = centerY - height;
centerY = centerY + height;
break;
}
}
if(centerX < 0)
centerX = 0;
if(centerX + width > this.chartProp.widthCanvas / pxToMm)
centerX = this.chartProp.widthCanvas / pxToMm - width;
if(centerY < 0)
centerY = 0;
if(centerY + height > this.chartProp.heightCanvas / pxToMm)
centerY = this.chartProp.heightCanvas / pxToMm - height;
return {x: centerX, y: centerY};
},
......@@ -2477,7 +2472,6 @@ drawLineChart.prototype =
var centerX = x - width/2;
var centerY = y - height/2;
//TODO высчитать позиции, как в екселе
switch ( point.compiledDlb.dLblPos )
{
case DLBL_POS_B:
......@@ -2487,33 +2481,17 @@ drawLineChart.prototype =
}
case DLBL_POS_BEST_FIT:
{
//centerY = centerY + 27 / pxToMm;
break;
}
case DLBL_POS_CTR:
{
break;
}
case DLBL_POS_IN_BASE:
{
//centerY = centerY + 27 / pxToMm;
break;
}
case DLBL_POS_IN_END:
{
//centerY = centerY + 27 / pxToMm;
break;
}
case DLBL_POS_L:
{
centerX = centerX - width/2 - constMargin;
break;
}
case DLBL_POS_OUT_END:
{
//centerY = centerY + 27 / pxToMm;
break;
}
case DLBL_POS_R:
{
centerX = centerX + width/2 + constMargin;
......@@ -2525,6 +2503,17 @@ drawLineChart.prototype =
break;
}
}
if(centerX < 0)
centerX = 0;
if(centerX + width > this.chartProp.widthCanvas / pxToMm)
centerX = this.chartProp.widthCanvas / pxToMm - width;
if(centerY < 0)
centerY = 0;
if(centerY + height > this.chartProp.heightCanvas / pxToMm)
centerY = this.chartProp.heightCanvas / pxToMm - height;
return {x: centerX, y: centerY};
},
......@@ -2722,7 +2711,6 @@ drawAreaChart.prototype =
var centerX = x - width/2;
var centerY = y - height/2;
//TODO высчитать позиции, как в екселе + ограничения
switch ( point.compiledDlb.dLblPos )
{
case DLBL_POS_B:
......@@ -2732,33 +2720,17 @@ drawAreaChart.prototype =
}
case DLBL_POS_BEST_FIT:
{
//centerY = centerY + 27 / pxToMm;
break;
}
case DLBL_POS_CTR:
{
break;
}
case DLBL_POS_IN_BASE:
{
//centerY = centerY + 27 / pxToMm;
break;
}
case DLBL_POS_IN_END:
{
//centerY = centerY + 27 / pxToMm;
break;
}
case DLBL_POS_L:
{
centerX = centerX - width/2 - constMargin;
break;
}
case DLBL_POS_OUT_END:
{
//centerY = centerY + 27 / pxToMm;
break;
}
case DLBL_POS_R:
{
centerX = centerX + width/2 + constMargin;
......@@ -2770,9 +2742,17 @@ drawAreaChart.prototype =
break;
}
}
if(centerX < 0)
centerX = 0;
if(centerX + width > this.chartProp.widthCanvas / pxToMm)
centerX = this.chartProp.widthCanvas / pxToMm - width;
if(centerY < 0)
centerY = 0;
if(centerY + height > this.chartProp.heightCanvas / pxToMm)
centerY = this.chartProp.heightCanvas / pxToMm - height;
return {x: centerX, y: centerY};
},
......@@ -3056,17 +3036,8 @@ drawHBarChart.prototype =
var centerX, centerY;
//TODO высчитать позиции, как в екселе
switch ( point.compiledDlb.dLblPos )
{
case DLBL_POS_B:
{
centerX = x + w/2 - width/2;
centerY = y;
if( point.val > 0 )
centerY = y - height;
break;
}
case DLBL_POS_BEST_FIT:
{
break;
......@@ -3093,10 +3064,6 @@ drawHBarChart.prototype =
centerX = x;
break;
}
case DLBL_POS_L:
{
break;
}
case DLBL_POS_OUT_END:
{
centerX = x + w;
......@@ -3105,18 +3072,17 @@ drawHBarChart.prototype =
centerX = x - width;
break;
}
case DLBL_POS_R:
{
break;
}
case DLBL_POS_T:
{
break;
}
}
if(centerX < 0)
centerX = 0;
if(centerX + width > this.chartProp.widthCanvas / pxToMm)
centerX = this.chartProp.widthCanvas / pxToMm - width;
if(centerY < 0)
centerY = 0;
if(centerY + height > this.chartProp.heightCanvas / pxToMm)
centerY = this.chartProp.heightCanvas / pxToMm - height;
return {x: centerX, y: centerY};
},
......@@ -3652,7 +3618,6 @@ drawScatterChart.prototype =
var centerX = x - width/2;
var centerY = y - height/2;
//TODO высчитать позиции, как в екселе + ограничения за пределы экрана
switch ( point.compiledDlb.dLblPos )
{
case DLBL_POS_B:
......@@ -3669,26 +3634,11 @@ drawScatterChart.prototype =
{
break;
}
case DLBL_POS_IN_BASE:
{
//centerY = centerY + 27 / pxToMm;
break;
}
case DLBL_POS_IN_END:
{
//centerY = centerY + 27 / pxToMm;
break;
}
case DLBL_POS_L:
{
centerX = centerX - width/2 - constMargin;
break;
}
case DLBL_POS_OUT_END:
{
//centerY = centerY + 27 / pxToMm;
break;
}
case DLBL_POS_R:
{
centerX = centerX + width/2 + constMargin;
......@@ -3700,6 +3650,17 @@ drawScatterChart.prototype =
break;
}
}
if(centerX < 0)
centerX = 0;
if(centerX + width > this.chartProp.widthCanvas / pxToMm)
centerX = this.chartProp.widthCanvas / pxToMm - width;
if(centerY < 0)
centerY = 0;
if(centerY + height > this.chartProp.heightCanvas / pxToMm)
centerY = this.chartProp.heightCanvas / pxToMm - height;
return {x: centerX, y: centerY};
},
......
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