Commit 1986e5d8 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@54087 954022d7-b5bf-4e40-9824-e11837661b57
parent 8c513567
...@@ -2458,7 +2458,7 @@ drawLineChart.prototype = ...@@ -2458,7 +2458,7 @@ drawLineChart.prototype =
} }
case DLBL_POS_L: case DLBL_POS_L:
{ {
centerX = centerX - height/2 - constMargin; centerX = centerX - width/2 - constMargin;
break; break;
} }
case DLBL_POS_OUT_END: case DLBL_POS_OUT_END:
...@@ -2468,7 +2468,7 @@ drawLineChart.prototype = ...@@ -2468,7 +2468,7 @@ drawLineChart.prototype =
} }
case DLBL_POS_R: case DLBL_POS_R:
{ {
centerX = centerX + height/2 + constMargin; centerX = centerX + width/2 + constMargin;
break; break;
} }
case DLBL_POS_T: case DLBL_POS_T:
...@@ -3221,36 +3221,54 @@ drawScatterChart.prototype = ...@@ -3221,36 +3221,54 @@ drawScatterChart.prototype =
points[n] = {x: xVal, y: yVal} points[n] = {x: xVal, y: yVal}
} }
for(var k = 1; k < points.length; k++) for(var k = 0; k < points.length; k++)
{ {
if(minOy >= 0 && maxOy > 0) if(k == points.length - 1)
{ {
y = trueHeight - (points[k-1].y - Math.abs(minOy))*koffY + this.chartProp.chartGutter._top; if(minOy >= 0 && maxOy > 0)
y1 = trueHeight - (points[k].y - Math.abs(minOy))*koffY + this.chartProp.chartGutter._top; {
y = trueHeight - (points[k].y - Math.abs(minOy))*koffY + this.chartProp.chartGutter._top;
}
else
{
y = trueHeight - (points[k].y + Math.abs(minOy))*koffY + this.chartProp.chartGutter._top;
}
x = (points[k].x + Math.abs(minOx))*koffX + this.chartProp.chartGutter._left;
this.paths.points[i][k] = this._calculatePoint(x, y, seria.yVal.numRef.numCache.pts[k].compiledMarker.size, seria.yVal.numRef.numCache.pts[k].compiledMarker.symbol);
} }
else else
{ {
y = trueHeight - (points[k-1].y + Math.abs(minOy))*koffY + this.chartProp.chartGutter._top; if(minOy >= 0 && maxOy > 0)
y1 = trueHeight - (points[k].y + Math.abs(minOy))*koffY + this.chartProp.chartGutter._top; {
y = trueHeight - (points[k].y - Math.abs(minOy))*koffY + this.chartProp.chartGutter._top;
y1 = trueHeight - (points[k + 1].y - Math.abs(minOy))*koffY + this.chartProp.chartGutter._top;
}
else
{
y = trueHeight - (points[k].y + Math.abs(minOy))*koffY + this.chartProp.chartGutter._top;
y1 = trueHeight - (points[k + 1].y + Math.abs(minOy))*koffY + this.chartProp.chartGutter._top;
}
x = (points[k].x + Math.abs(minOx))*koffX + this.chartProp.chartGutter._left;
x1 = (points[k + 1].x + Math.abs(minOx))*koffX + this.chartProp.chartGutter._left;
if(!this.paths.series)
this.paths.series = [];
if(!this.paths.series[i])
this.paths.series[i] = [];
if(!this.paths.points)
this.paths.points = [];
if(!this.paths.points[i])
this.paths.points[i] = [];
this.paths.series[i][k] = this._calculateLine(x, y, x1, y1);
this.paths.points[i][k] = this._calculatePoint(x, y, seria.yVal.numRef.numCache.pts[k].compiledMarker.size, seria.yVal.numRef.numCache.pts[k].compiledMarker.symbol);
} }
x = (points[k-1].x + Math.abs(minOx))*koffX + this.chartProp.chartGutter._left;
x1 = (points[k].x + Math.abs(minOx))*koffX + this.chartProp.chartGutter._left;
if(!this.paths.series)
this.paths.series = [];
if(!this.paths.series[i])
this.paths.series[i] = [];
if(!this.paths.points)
this.paths.points = [];
if(!this.paths.points[i])
this.paths.points[i] = [];
this.paths.series[i][k] = this._calculateLine(x, y, x1, y1);
if(k == 1)
this.paths.points[i][0] = this._calculatePoint(x, y, seria.yVal.numRef.numCache.pts[0].compiledMarker.size, seria.yVal.numRef.numCache.pts[0].compiledMarker.symbol);
this.paths.points[i][k] = this._calculatePoint(x1, y1, seria.yVal.numRef.numCache.pts[k].compiledMarker.size, seria.yVal.numRef.numCache.pts[k].compiledMarker.symbol);
} }
} }
}, },
...@@ -3264,7 +3282,8 @@ drawScatterChart.prototype = ...@@ -3264,7 +3282,8 @@ drawScatterChart.prototype =
brush = seria.brush; brush = seria.brush;
pen = seria.pen; pen = seria.pen;
for(var k = 1; k < this.paths.series[i].length; k++) //draw line
for(var k = 0; k < this.paths.series[i].length; k++)
{ {
brush = this.chartProp.series[i].brush; brush = this.chartProp.series[i].brush;
pen = this.chartProp.series[i].pen; pen = this.chartProp.series[i].pen;
...@@ -3276,19 +3295,11 @@ drawScatterChart.prototype = ...@@ -3276,19 +3295,11 @@ drawScatterChart.prototype =
//draw line //draw line
this._drawPath(this.paths.series[i][k], brush, pen, true); this._drawPath(this.paths.series[i][k], brush, pen, true);
}
//draw point
if(k == 1) //draw point
{ for(var k = 0; k < this.paths.points[i].length; k++)
markerBrush = this.chartProp.series[i].yVal.numRef.numCache.pts[0].compiledMarker.brush; {
markerPen = this.chartProp.series[i].yVal.numRef.numCache.pts[0].compiledMarker.pen;
//frame of point
if(this.paths.points[i][0].framePaths)
this._drawPath(this.paths.points[i][0].framePaths, markerBrush, markerPen, false);
//point
this._drawPath(this.paths.points[i][0].path, markerBrush, markerPen, true);
}
markerBrush = this.chartProp.series[i].yVal.numRef.numCache.pts[k].compiledMarker.brush; markerBrush = this.chartProp.series[i].yVal.numRef.numCache.pts[k].compiledMarker.brush;
markerPen = this.chartProp.series[i].yVal.numRef.numCache.pts[k].compiledMarker.pen; markerPen = this.chartProp.series[i].yVal.numRef.numCache.pts[k].compiledMarker.pen;
...@@ -3442,6 +3453,79 @@ drawScatterChart.prototype = ...@@ -3442,6 +3453,79 @@ drawScatterChart.prototype =
return result; return result;
}, },
_calculateDLbl: function(chartSpace, ser, val)
{
var point = this.chartProp.series[ser - 1].yVal.numRef.numCache.pts[val];
var path;
if(val == this.chartProp.series[ser - 1].yVal.numRef.numCache.pts.length - 1)
path = this.paths.series[ser - 1][val - 1].ArrPathCommand[1];
else
path = this.paths.series[ser - 1][val].ArrPathCommand[0];
var x = path.X;
var y = path.Y;
var pxToMm = this.chartProp.pxToMM;
var constMargin = 5 / pxToMm;
var width = point.compiledDlb.extX;
var height = point.compiledDlb.extY;
var centerX = x - width/2;
var centerY = y - height/2;
//TODO высчитать позиции, как в екселе + ограничения за пределы экрана
switch ( point.compiledDlb.dLblPos )
{
case DLBL_POS_B:
{
centerY = centerY + height/2 + constMargin;
break;
}
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;
break;
}
case DLBL_POS_T:
{
centerY = centerY - height/2 - constMargin;
break;
}
}
return {x: centerX, y: centerY};
},
_drawPath: function(path, brush, pen, stroke) _drawPath: function(path, brush, pen, stroke)
{ {
path.stroke = stroke; path.stroke = stroke;
......
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