Commit ff063ebf 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@54050 954022d7-b5bf-4e40-9824-e11837661b57
parent d3c208a3
"use strict";
"use strict";
function CAreaChart()
{
......@@ -3132,6 +3132,9 @@ function CDLbl()
this.parent = null;
this.anchorX = null;
this.anchorY = null;
this.recalcInfo =
{
recalcTransform: true,
......@@ -3142,8 +3145,14 @@ function CDLbl()
recalculatePen: true
}
this.chart = null;//выставляется при пересчете
this.series = null;//выставляется при пересчете
this.chart = null;//
this.series = null;//
this.x = 0;
this.y = 0;
this.calcX = null;
this.calcY = null;
this.txBody = null;
......@@ -3220,6 +3229,10 @@ CDLbl.prototype =
this.recalculateTransformText();
this.recalcInfo.recalcTranformText = false;
}
if(this.chart)
{
this.chart.addToSetPosition(this);
}
}, this, []);
},
......@@ -3238,8 +3251,32 @@ CDLbl.prototype =
recalculateTransform: function()
{
if(this.layout && this.layout.manualLayout)
{
if(typeof this.layout.manualLayout.x === "number")
{
this.calcX = this.chart.extX*this.layout.x + this.x;
}
else
{
this.calcX = this.x;
}
if(typeof this.layout.manualLayout.y === "number")
{
this.calcY = this.chart.extY*this.layout.y + this.y;
}
else
{
this.calcY = this.y;
}
}
else
{
this.calcX = this.x;
this.calcY = this.y;
}
this.transform.Reset();
global_MatrixTransformer.TranslateAppend(this.transform, this.x, this.y);
global_MatrixTransformer.TranslateAppend(this.transform, this.calcX, this.calcY);
if (isRealObject(this.chart))
{
global_MatrixTransformer.MultiplyAppend(this.transform, this.chart.getTransformMatrix());
......@@ -3250,7 +3287,7 @@ CDLbl.prototype =
recalculateTransformText: function()
{
this.transformText.Reset();
global_MatrixTransformer.TranslateAppend(this.transformText, this.x + 1, this.y + 0.5);
global_MatrixTransformer.TranslateAppend(this.transformText, this.calcX + 1, this.calcY + 0.5);
if (isRealObject(this.chart))
{
global_MatrixTransformer.MultiplyAppend(this.transformText, this.chart.getTransformMatrix());
......@@ -3382,8 +3419,8 @@ CDLbl.prototype =
if(this.txBody)
{
var max_box_width = this.chart.extX/5.1;/*получено экспериментальным путем нужно уточнить*/
var max_content_width = max_box_width - 1.25;/*excel слева делает отступ 1мм а справа 0.25мм*/
var max_box_width = this.chart.extX/5.1;/* */
var max_content_width = max_box_width - 1.25;/*excel 1 0.25*/
var content = this.txBody.content;
content.Reset(0, 0, max_content_width, 20000);
content.Recalculate_Page(0, true);
......@@ -3404,7 +3441,7 @@ CDLbl.prototype =
content.Reset(0, 0, max_width, 20000);
content.Recalculate_Page(0, true);
this.extX = max_width + 1.25;
this.extY = this.txBody.content.Get_SummaryHeight() + 1/*по полмиллиметра сверху и снизу отступы*/;
this.extY = this.txBody.content.Get_SummaryHeight() + 1/* */;
this.x = 0;
this.y = 0;
}
......
......@@ -35,7 +35,8 @@ CChartSpace.prototype.setRecalculateInfo = function()
recalculateSeriesColors: true,
recalculateMarkers: true,
recalculateGridLines: true,
recalculateDLbls: true
recalculateDLbls: true,
dataLbls:[]
};
this.baseColors = [];
this.bounds = {l: 0, t: 0, r: 0, b:0, w: 0, h:0};
......@@ -65,6 +66,12 @@ CChartSpace.prototype.recalcDLbls = function()
{
this.recalcInfo.recalculateDLbls = true;
};
CChartSpace.prototype.addToSetPosition = function(dLbl)
{
this.recalcInfo.dataLbls.push(dLbl);
};
CChartSpace.prototype.addToRecalculate = CShape.prototype.addToRecalculate;
CChartSpace.prototype.handleUpdatePosition = function()
......@@ -110,6 +117,8 @@ CChartSpace.prototype.canRotate = function()
return false;
}
CChartSpace.prototype.createResizeTrack = CShape.prototype.createResizeTrack;
CChartSpace.prototype.createMoveTrack = CShape.prototype.createMoveTrack;
CChartSpace.prototype.getAspect = CShape.prototype.getAspect;
......@@ -199,16 +208,22 @@ CChartSpace.prototype.recalculate = function()
this.recalculateGridLines();
this.recalcInfo.recalculateGridLines = false;
}
if(this.recalcInfo.recalculateDLbls)
{
this.recalculateDLbls();
this.recalcInfo.recalculateDLbls = false;
}
if(this.recalcInfo.recalculateChart)
{
this.recalculateChart();
this.recalcInfo.recalculateChart = false;
}
if(this.recalcInfo.recalculateDLbls)
for(var i = 0; i < this.recalcInfo.dataLbls.length; ++i)
{
this.recalculateDLbls();
this.recalcInfo.recalculateDLbls = false;
var pos = this.chartObj.reCalculatePositionText("dlbl", this, this.recalcInfo.dataLbls[i].series.idx, this.recalcInfo.dataLbls[i].pt.idx);
this.recalcInfo.dataLbls[i].setPosition(pos.x, pos.y);
}
this.recalcInfo.dataLbls.length = 0;
}, this, []);
};
CChartSpace.prototype.deselect = CShape.prototype.deselect;
......@@ -924,7 +939,6 @@ CChartSpace.prototype.recalculateDLbls = function()
pt.compiledDlb.chart = this;
pt.compiledDlb.series = ser;
pt.compiledDlb.pt = pt;
pt.compiledDlb.recalculate();
}
}
......
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