Commit eef9480d authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Изменена позиция диаграммы во фрейме

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57242 954022d7-b5bf-4e40-9824-e11837661b57
parent 9188ea68
...@@ -2586,8 +2586,16 @@ function DrawingObjects() { ...@@ -2586,8 +2586,16 @@ function DrawingObjects() {
oNewChartSpace.addToDrawingObjects(); oNewChartSpace.addToDrawingObjects();
oNewChartSpace.recalculate(); oNewChartSpace.recalculate();
CheckSpPrXfrm(oNewChartSpace); CheckSpPrXfrm(oNewChartSpace);
oNewChartSpace.spPr.xfrm.setOffX(50);
oNewChartSpace.spPr.xfrm.setOffY(36); var canvas_height = worksheet.drawingCtx.getHeight(3);
var pos_y = (canvas_height - oNewChartSpace.spPr.xfrm.extY)/2;
if(pos_y < 0)
{
pos_y = 0;
}
oNewChartSpace.spPr.xfrm.setOffX(70);
oNewChartSpace.spPr.xfrm.setOffY(pos_y);
oNewChartSpace.recalculate(); oNewChartSpace.recalculate();
var min_r = 0, max_r = 0, min_c = 0, max_c = 0; var min_r = 0, max_r = 0, min_c = 0, max_c = 0;
......
...@@ -351,8 +351,6 @@ DrawingObjectsController.prototype.addChartDrawingObject = function(options) ...@@ -351,8 +351,6 @@ DrawingObjectsController.prototype.addChartDrawingObject = function(options)
chart.setStyle(2); chart.setStyle(2);
chart.setBDeleted(false); chart.setBDeleted(false);
this.resetSelection(); this.resetSelection();
var chartLeft = this.drawingObjects.convertMetric(options && options.left ? options.left : (this.drawingObjects.getContextWidth() / 2) - c_oAscChartDefines.defaultChartWidth / 2, 1, 3);
var chartTop = this.drawingObjects.convertMetric(options && options.top ? options.top : (this.drawingObjects.getContextHeight() / 2) - c_oAscChartDefines.defaultChartHeight / 2, 1, 3);
var w, h; var w, h;
if(isRealObject(options) && isRealNumber(options.width) && isRealNumber(options.height)) if(isRealObject(options) && isRealNumber(options.width) && isRealNumber(options.height))
{ {
...@@ -364,6 +362,28 @@ DrawingObjectsController.prototype.addChartDrawingObject = function(options) ...@@ -364,6 +362,28 @@ DrawingObjectsController.prototype.addChartDrawingObject = function(options)
w = this.drawingObjects.convertMetric(c_oAscChartDefines.defaultChartWidth, 0, 3); w = this.drawingObjects.convertMetric(c_oAscChartDefines.defaultChartWidth, 0, 3);
h = this.drawingObjects.convertMetric(c_oAscChartDefines.defaultChartHeight, 0, 3); h = this.drawingObjects.convertMetric(c_oAscChartDefines.defaultChartHeight, 0, 3);
} }
var chartLeft, chartTop;
if(options && isRealNumber(options.left) && options.left >= 0 && isRealNumber(options.top) && options.top >= 0)
{
chartLeft = this.drawingObjects.convertMetric(options.left, 0, 3);
chartTop = this.drawingObjects.convertMetric(options.top, 0, 3);
}
else
{
chartLeft = this.drawingObjects.convertMetric((this.drawingObjects.getContextWidth() - w) / 2, 0, 3);
if(chartLeft < 0)
{
chartLeft = 0;
}
chartTop = this.drawingObjects.convertMetric((this.drawingObjects.getContextHeight() - h) / 2, 0, 3);
if(chartTop < 0)
{
chartTop = 0;
}
}
chart.setSpPr(new CSpPr()); chart.setSpPr(new CSpPr());
chart.spPr.setParent(chart); chart.spPr.setParent(chart);
chart.spPr.setXfrm(new CXfrm()); chart.spPr.setXfrm(new CXfrm());
......
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