Commit f99ecbf0 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@54733 954022d7-b5bf-4e40-9824-e11837661b57
parent 4e50a243
......@@ -139,6 +139,16 @@ CChartsDrawer.prototype =
pos = this._calculatePositionCatAx(chartSpace);
break;
}
case "legend":
{
pos = this._calculatePositionLegend(chartSpace);
break;
}
default:
{
pos = {x: 0, y: 0};
break;
}
}
return {x: pos.x, y : pos.y};
},
......@@ -187,6 +197,56 @@ CChartsDrawer.prototype =
return {x: x, y: y}
},
_calculatePositionLegend: function(chartSpace)
{
var widthLegend = chartSpace.chart.legend.extX;
var heightLegend = chartSpace.chart.legend.extY;
var standartMargin = 13;
var x, y;
switch ( chartSpace.chart.legend.legendPos )
{
case LEGEND_POS_L:
{
x = standartMargin / 2 / this.calcProp.pxToMM;
y = this.calcProp.heightCanvas / 2 / this.calcProp.pxToMM - heightLegend / 2;
break;
}
case LEGEND_POS_T:
{
x = this.calcProp.widthCanvas / 2 / this.calcProp.pxToMM - widthLegend / 2;
y = standartMargin / 2 / this.calcProp.pxToMM;
break;
}
case LEGEND_POS_R:
{
x = (this.calcProp.widthCanvas - standartMargin / 2) / this.calcProp.pxToMM - widthLegend;
y = (this.calcProp.heightCanvas / 2) / this.calcProp.pxToMM - heightLegend / 2;
break;
}
case LEGEND_POS_B:
{
x = this.calcProp.widthCanvas / 2 / this.calcProp.pxToMM - widthLegend / 2;
y = (this.calcProp.heightCanvas - standartMargin / 2) / this.calcProp.pxToMM - heightLegend;
break;
}
case LEGEND_POS_TR:
{
x = (this.calcProp.widthCanvas - standartMargin / 2) / this.calcProp.pxToMM - widthLegend;
y = standartMargin / 2 / this.calcProp.pxToMM;
break;
}
default:
{
x = (this.calcProp.widthCanvas - standartMargin / 2) / this.calcProp.pxToMM - widthLegend;
y = (this.calcProp.heightCanvas) / this.calcProp.pxToMM - heightLegend / 2;
break;
}
}
return {x: x, y: y}
},
_calculateProperties: function(chartProp)
{
if(!this.calcProp.scale)
......
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