Commit 517fb5d5 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@54893 954022d7-b5bf-4e40-9824-e11837661b57
parent dda01436
...@@ -82,11 +82,11 @@ CChartsDrawer.prototype = ...@@ -82,11 +82,11 @@ CChartsDrawer.prototype =
{ {
newChart = new drawDoughnutChart(); newChart = new drawDoughnutChart();
break; break;
} }
case "Radar": case "Radar":
{ {
newChart = new drawRadarChart(); newChart = new drawRadarChart();
break; break;
} }
} }
this.chart = newChart; this.chart = newChart;
...@@ -400,11 +400,11 @@ CChartsDrawer.prototype = ...@@ -400,11 +400,11 @@ CChartsDrawer.prototype =
{ {
this.calcProp.type = "DoughnutChart"; this.calcProp.type = "DoughnutChart";
break; break;
} }
case historyitem_type_RadarChart: case historyitem_type_RadarChart:
{ {
this.calcProp.type = "Radar"; this.calcProp.type = "Radar";
break; break;
} }
}; };
...@@ -2054,7 +2054,7 @@ CChartsDrawer.prototype = ...@@ -2054,7 +2054,7 @@ CChartsDrawer.prototype =
var max1; var max1;
var arr = []; var arr = [];
//находим минимальное значение //находим минимальное значение
var min, max, greaterNullNum, lengthNum; var min, max, greaterNullNum, lengthNum;
if('Bar' == mainObj.type) if('Bar' == mainObj.type)
{ {
...@@ -2539,125 +2539,125 @@ CChartsDrawer.prototype = ...@@ -2539,125 +2539,125 @@ CChartsDrawer.prototype =
newZ = newZ; newZ = newZ;
return {x: newX,y: newY,z: newZ}; return {x: newX,y: newY,z: newZ};
}, },
calculatePoint: function(x, y, size, symbol) calculatePoint: function(x, y, size, symbol)
{ {
size = size / 2.69; size = size / 2.69;
var halfSize = size / 2; var halfSize = size / 2;
var path = new Path(); var path = new Path();
var pathH = this.calcProp.pathH; var pathH = this.calcProp.pathH;
var pathW = this.calcProp.pathW; var pathW = this.calcProp.pathW;
var gdLst = []; var gdLst = [];
path.pathH = pathH; path.pathH = pathH;
path.pathW = pathW; path.pathW = pathW;
gdLst["w"] = 1; gdLst["w"] = 1;
gdLst["h"] = 1; gdLst["h"] = 1;
var framePaths = null; var framePaths = null;
var result; var result;
/* /*
var SYMBOL_PICTURE = 5;*/ var SYMBOL_PICTURE = 5;*/
switch ( symbol ) switch ( symbol )
{ {
case SYMBOL_DASH: case SYMBOL_DASH:
{ {
path.moveTo((x - halfSize) * pathW, y * pathW); path.moveTo((x - halfSize) * pathW, y * pathW);
path.lnTo((x + halfSize) * pathW, y * pathW); path.lnTo((x + halfSize) * pathW, y * pathW);
break; break;
} }
case SYMBOL_DOT: case SYMBOL_DOT:
{ {
path.moveTo((x - halfSize / 2) * pathW, y * pathW); path.moveTo((x - halfSize / 2) * pathW, y * pathW);
path.lnTo((x + halfSize / 2) * pathW, y * pathW); path.lnTo((x + halfSize / 2) * pathW, y * pathW);
break; break;
} }
case SYMBOL_PLUS: case SYMBOL_PLUS:
{ {
path.moveTo(x * pathW, (y + halfSize) * pathW); path.moveTo(x * pathW, (y + halfSize) * pathW);
path.lnTo(x * pathW, (y - halfSize) * pathW); path.lnTo(x * pathW, (y - halfSize) * pathW);
path.moveTo((x - halfSize) * pathW, y * pathW); path.moveTo((x - halfSize) * pathW, y * pathW);
path.lnTo((x + halfSize) * pathW, y * pathW); path.lnTo((x + halfSize) * pathW, y * pathW);
break; break;
} }
case SYMBOL_CIRCLE: case SYMBOL_CIRCLE:
{ {
path.moveTo((x + halfSize) * pathW, y * pathW); path.moveTo((x + halfSize) * pathW, y * pathW);
path.arcTo(halfSize * pathW, halfSize * pathW, 0, Math.PI * 2 * cToDeg); path.arcTo(halfSize * pathW, halfSize * pathW, 0, Math.PI * 2 * cToDeg);
break; break;
} }
case SYMBOL_STAR: case SYMBOL_STAR:
{ {
path.moveTo((x - halfSize) * pathW, (y + halfSize) * pathW); path.moveTo((x - halfSize) * pathW, (y + halfSize) * pathW);
path.lnTo((x + halfSize) * pathW, (y - halfSize) * pathW); path.lnTo((x + halfSize) * pathW, (y - halfSize) * pathW);
path.moveTo((x + halfSize) * pathW, (y + halfSize) * pathW); path.moveTo((x + halfSize) * pathW, (y + halfSize) * pathW);
path.lnTo((x - halfSize) * pathW, (y - halfSize) * pathW); path.lnTo((x - halfSize) * pathW, (y - halfSize) * pathW);
path.moveTo(x * pathW, (y + halfSize) * pathW); path.moveTo(x * pathW, (y + halfSize) * pathW);
path.lnTo(x * pathW, (y - halfSize) * pathW); path.lnTo(x * pathW, (y - halfSize) * pathW);
break; break;
} }
case SYMBOL_X: case SYMBOL_X:
{ {
path.moveTo((x - halfSize) * pathW, (y + halfSize) * pathW); path.moveTo((x - halfSize) * pathW, (y + halfSize) * pathW);
path.lnTo((x + halfSize) * pathW, (y - halfSize) * pathW); path.lnTo((x + halfSize) * pathW, (y - halfSize) * pathW);
path.moveTo((x + halfSize) * pathW, (y + halfSize) * pathW); path.moveTo((x + halfSize) * pathW, (y + halfSize) * pathW);
path.lnTo((x - halfSize) * pathW, (y - halfSize) * pathW); path.lnTo((x - halfSize) * pathW, (y - halfSize) * pathW);
break; break;
} }
case SYMBOL_TRIANGLE: case SYMBOL_TRIANGLE:
{ {
path.moveTo((x - size/Math.sqrt(3)) * pathW, (y + size/3) * pathW); path.moveTo((x - size/Math.sqrt(3)) * pathW, (y + size/3) * pathW);
path.lnTo(x * pathW, (y - (2/3)*size) * pathW); path.lnTo(x * pathW, (y - (2/3)*size) * pathW);
path.lnTo((x + size/Math.sqrt(3)) * pathW, (y + size/3) * pathW) path.lnTo((x + size/Math.sqrt(3)) * pathW, (y + size/3) * pathW)
path.lnTo((x - size/Math.sqrt(3)) * pathW, (y + size/3) * pathW); path.lnTo((x - size/Math.sqrt(3)) * pathW, (y + size/3) * pathW);
break; break;
} }
case SYMBOL_SQUARE: case SYMBOL_SQUARE:
{ {
path.moveTo((x - halfSize) * pathW, (y + halfSize) * pathW); path.moveTo((x - halfSize) * pathW, (y + halfSize) * pathW);
path.lnTo((x - halfSize) * pathW, (y - halfSize) * pathW); path.lnTo((x - halfSize) * pathW, (y - halfSize) * pathW);
path.lnTo((x + halfSize) * pathW, (y - halfSize) * pathW); path.lnTo((x + halfSize) * pathW, (y - halfSize) * pathW);
path.lnTo((x + halfSize) * pathW, (y + halfSize) * pathW); path.lnTo((x + halfSize) * pathW, (y + halfSize) * pathW);
path.lnTo((x - halfSize) * pathW, (y + halfSize) * pathW); path.lnTo((x - halfSize) * pathW, (y + halfSize) * pathW);
} }
case SYMBOL_DIAMOND: case SYMBOL_DIAMOND:
{ {
path.moveTo((x - halfSize) * pathW, y * pathW); path.moveTo((x - halfSize) * pathW, y * pathW);
path.lnTo(x * pathW, (y - halfSize) * pathW); path.lnTo(x * pathW, (y - halfSize) * pathW);
path.lnTo((x + halfSize) * pathW, y * pathW); path.lnTo((x + halfSize) * pathW, y * pathW);
path.lnTo(x * pathW, (y + halfSize) * pathW); path.lnTo(x * pathW, (y + halfSize) * pathW);
path.lnTo((x - halfSize) * pathW, y * pathW); path.lnTo((x - halfSize) * pathW, y * pathW);
break; break;
} }
} }
if(symbol == "Plus" || symbol == "Star" || symbol == "X") if(symbol == "Plus" || symbol == "Star" || symbol == "X")
{ {
framePaths = new Path(); framePaths = new Path();
framePaths.moveTo((x - halfSize) * pathW, (y + halfSize) * pathW); framePaths.moveTo((x - halfSize) * pathW, (y + halfSize) * pathW);
framePaths.lnTo((x - halfSize) * pathW, (y - halfSize) * pathW); framePaths.lnTo((x - halfSize) * pathW, (y - halfSize) * pathW);
framePaths.lnTo((x + halfSize) * pathW, (y - halfSize) * pathW); framePaths.lnTo((x + halfSize) * pathW, (y - halfSize) * pathW);
framePaths.lnTo((x + halfSize) * pathW, (y + halfSize) * pathW); framePaths.lnTo((x + halfSize) * pathW, (y + halfSize) * pathW);
framePaths.lnTo((x - halfSize) * pathW, (y + halfSize) * pathW); framePaths.lnTo((x - halfSize) * pathW, (y + halfSize) * pathW);
} }
path.recalculate(gdLst); path.recalculate(gdLst);
if(framePaths) if(framePaths)
framePaths.recalculate(gdLst); framePaths.recalculate(gdLst);
result = {framePaths: framePaths, path: path}; result = {framePaths: framePaths, path: path};
return result; return result;
} }
} }
...@@ -4338,24 +4338,24 @@ drawRadarChart.prototype = ...@@ -4338,24 +4338,24 @@ drawRadarChart.prototype =
if(dataSeries.length == 1) if(dataSeries.length == 1)
{ {
n = 0; n = 0;
//рассчитываем значения //рассчитываем значения
val = this._getYVal(n, i); val = this._getYVal(n, i);
//точки находятся внутри диапазона //точки находятся внутри диапазона
y = val * xDiff; y = val * xDiff;
x = xCenter; x = xCenter;
radius = y; radius = y;
y = yCenter - radius * Math.cos(n * tempAngle); y = yCenter - radius * Math.cos(n * tempAngle);
x = x + radius * Math.sin(n * tempAngle); x = x + radius * Math.sin(n * tempAngle);
if(!this.paths.points) if(!this.paths.points)
this.paths.points = []; this.paths.points = [];
if(!this.paths.points[i]) if(!this.paths.points[i])
this.paths.points[i] = []; this.paths.points[i] = [];
this.paths.points[i][n] = this.cChartDrawer.calculatePoint(x, y, dataSeries[n].compiledMarker.size, dataSeries[n].compiledMarker.symbol); this.paths.points[i][n] = this.cChartDrawer.calculatePoint(x, y, dataSeries[n].compiledMarker.size, dataSeries[n].compiledMarker.symbol);
} }
else else
...@@ -5259,6 +5259,303 @@ drawStockChart.prototype = ...@@ -5259,6 +5259,303 @@ drawStockChart.prototype =
} }
}; };
function drawBubbleChart()
{
this.chartProp = null;
this.cChartDrawer = null;
this.cShapeDrawer = null;
this.paths = {};
}
drawBubbleChart.prototype =
{
reCalculate : function(chartProp, cShapeDrawer)
{
this.chartProp = chartProp.calcProp;
this.cChartDrawer = chartProp;
this.cShapeDrawer = cShapeDrawer;
this.paths = {};
this._recalculateScatter();
},
draw : function(chartProp, cShapeDrawer)
{
this.chartProp = chartProp.calcProp;
this.cChartDrawer = chartProp;
this.cShapeDrawer = cShapeDrawer;
this._drawScatter();
},
_recalculateScatter: function ()
{
//соответствует подписям оси категорий(OX)
var xPoints = this.cShapeDrawer.chart.plotArea.catAx.xPoints;
//соответствует подписям оси значений(OY)
var yPoints = this.cShapeDrawer.chart.plotArea.valAx.yPoints;
var trueHeight = this.chartProp.trueHeight;
var trueWidth = this.chartProp.trueWidth;
var minOy = this.chartProp.ymin;
var maxOy = this.chartProp.ymax;
var maxOx = this.chartProp.xScale[this.chartProp.xScale.length - 1];
var minOx = this.chartProp.xScale[0];
var digHeightOy = Math.abs(maxOy - minOy);
var digHeightOx = Math.abs(maxOx - minOx);
var koffX = trueWidth/digHeightOx;
var koffY = trueHeight/digHeightOy;
var seria, yVal, xVal, points, x, x1, y, y1, yNumCache, xNumCache;
for(var i = 0; i < this.chartProp.series.length; i++)
{
seria = this.chartProp.series[i];
points = [];
yNumCache = seria.yVal.numRef.numCache ? seria.yVal.numRef.numCache : seria.yVal.numRef.numLit;
for(var n = 0; n < yNumCache.pts.length; n++)
{
yVal = parseFloat(yNumCache.pts[n].val);
xNumCache = seria.xVal && seria.xVal.numRef ? seria.xVal.numRef.numCache : seria.xVal && seria.xVal.numLit ? seria.xVal.numLit : null;
if(xNumCache && xNumCache.pts[n] && xNumCache.pts[n].val)
{
if(!isNaN(parseFloat(xNumCache.pts[n].val)))
xVal = parseFloat(xNumCache.pts[n].val);
else
xVal = n + 1;
}
else
xVal = n + 1;
points[n] = {x: xVal, y: yVal}
}
for(var k = 0; k < points.length; k++)
{
y = this._getYPosition(points[k].y, yPoints);
x = this._getYPosition(points[k].x, xPoints, true);
if(!this.paths.points)
this.paths.points = [];
if(!this.paths.points[i])
this.paths.points[i] = [];
this.paths.points[i][k] = this._calculateBubble(x, y, yNumCache.pts[k].compiledMarker.size, yNumCache.pts[k].compiledMarker.symbol);
}
}
},
_drawScatter: function ()
{
var seria, brush, pen, markerBrush, markerPen, yNumCache;
for(var i = 0; i < this.chartProp.series.length; i++)
{
seria = this.chartProp.series[i];
brush = seria.brush;
pen = seria.pen;
//draw bubble
if(this.paths.points && this.paths.points[i])
{
for(var k = 0; k < this.paths.points[i].length; k++)
{
yNumCache = this.chartProp.series[i].yVal.numRef ? this.chartProp.series[i].yVal.numRef.numCache : this.chartProp.series[i].yVal.numLit;
markerBrush = yNumCache.pts[k].compiledMarker.brush;
markerPen = yNumCache.pts[k].compiledMarker.pen;
//point
this._drawPath(this.paths.points[i][k], markerBrush, markerPen, true);
}
}
}
},
_getYPosition: function(val, yPoints, isOx)
{
//позиция в заисимости от положения точек на оси OY
var result;
var resPos;
var resVal;
var diffVal;
if(val < yPoints[0].val)
{
resPos = Math.abs(yPoints[1].pos - yPoints[0].pos);
resVal = yPoints[1].val - yPoints[0].val;
diffVal = Math.abs(yPoints[0].val) - Math.abs(val);
result = yPoints[0].pos - (diffVal / resVal) * resPos;
}
else if(val > yPoints[yPoints.length - 1].val)
{
resPos = Math.abs(yPoints[1].pos - yPoints[0].pos);
resVal = yPoints[1].val - yPoints[0].val;
diffVal = Math.abs(yPoints[0].val) - Math.abs(val);
result = yPoints[0].pos + (diffVal / resVal) * resPos;
}
else
{
for(var s = 0; s < yPoints.length; s++)
{
if(val >= yPoints[s].val && val <= yPoints[s + 1].val)
{
resPos = Math.abs(yPoints[s + 1].pos - yPoints[s].pos);
resVal = yPoints[s + 1].val - yPoints[s].val;
if(!isOx)
result = - (resPos / resVal) * (Math.abs(val - yPoints[s].val)) + yPoints[s].pos;
else
result = (resPos / resVal) * (Math.abs(val - yPoints[s].val)) + yPoints[s].pos;
break;
}
}
}
return result;
},
_calculateLine: function(x, y, x1, y1)
{
var path = new Path();
var pathH = this.chartProp.pathH;
var pathW = this.chartProp.pathW;
var gdLst = [];
path.pathH = pathH;
path.pathW = pathW;
gdLst["w"] = 1;
gdLst["h"] = 1;
path.moveTo(x * pathH, y * pathW);
path.lnTo(x1 * pathH, y1 * pathW);
path.recalculate(gdLst);
return path;
},
_calculateDLbl: function(chartSpace, ser, val)
{
var point;
if(this.chartProp.series[ser - 1])
point = this.chartProp.series[ser - 1].yVal.numRef ? this.chartProp.series[ser - 1].yVal.numRef.numCache.pts[val] : this.chartProp.series[ser - 1].yVal.numLit.pts[val];
else
point = this.chartProp.series[ser].yVal.numRef ? this.chartProp.series[ser].yVal.numRef.numCache.pts[val] : this.chartProp.series[ser].yVal.numLit.pts[val];
var path;
/*if(this.paths.series && this.paths.series[ser - 1])
{
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];
}
else*/ if(this.paths.points)
{
if(this.paths.points[ser] && this.paths.points[ser][val])
path = this.paths.points[ser][val].path.ArrPathCommand[0];
}
if(!path)
return;
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;
switch ( point.compiledDlb.dLblPos )
{
case DLBL_POS_B:
{
centerY = centerY + height/2 + constMargin;
break;
}
case DLBL_POS_BEST_FIT:
{
break;
}
case DLBL_POS_CTR:
{
break;
}
case DLBL_POS_L:
{
centerX = centerX - width/2 - constMargin;
break;
}
case DLBL_POS_R:
{
centerX = centerX + width/2 + constMargin;
break;
}
case DLBL_POS_T:
{
centerY = centerY - height/2 - constMargin;
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};
},
_drawPath: function(path, brush, pen, stroke)
{
path.stroke = stroke;
var cGeometry = new CGeometry2();
this.cShapeDrawer.Clear();
this.cShapeDrawer.fromShape2({brush: brush, pen: pen} ,this.cShapeDrawer.Graphics, cGeometry);
cGeometry.AddPath(path);
this.cShapeDrawer.draw(cGeometry);
},
_calculateBubble: function(x, y, size)
{
var defaultSize = 4;
var path = new Path();
var pathH = this.chartProp.pathH;
var pathW = this.chartProp.pathW;
var gdLst = [];
path.pathH = pathH;
path.pathW = pathW;
gdLst["w"] = 1;
gdLst["h"] = 1;
path.moveTo((x + defaultSize) * pathW, y * pathH);
path.arcTo(defaultSize * pathW, defaultSize * pathW, 0, Math.PI * 2 * cToDeg);
path.recalculate(gdLst);
return path;
}
};
//*****GRID***** //*****GRID*****
function gridChart() function gridChart()
{ {
...@@ -5292,67 +5589,67 @@ gridChart.prototype = ...@@ -5292,67 +5589,67 @@ gridChart.prototype =
}, },
_calculateHorisontalLines : function() _calculateHorisontalLines : function()
{ {
var stepY = (this.chartProp.heightCanvas - this.chartProp.chartGutter._bottom - this.chartProp.chartGutter._top)/(this.chartProp.numhlines); var stepY = (this.chartProp.heightCanvas - this.chartProp.chartGutter._bottom - this.chartProp.chartGutter._top)/(this.chartProp.numhlines);
var minorStep = stepY / this.chartProp.numhMinorlines; var minorStep = stepY / this.chartProp.numhMinorlines;
var widthLine = this.chartProp.widthCanvas - (this.chartProp.chartGutter._left + this.chartProp.chartGutter._right); var widthLine = this.chartProp.widthCanvas - (this.chartProp.chartGutter._left + this.chartProp.chartGutter._right);
var posX = this.chartProp.chartGutter._left; var posX = this.chartProp.chartGutter._left;
var posY; var posY;
var posMinorY; var posMinorY;
var trueWidth = this.chartProp.trueWidth; var trueWidth = this.chartProp.trueWidth;
var trueHeight = this.chartProp.trueHeight; var trueHeight = this.chartProp.trueHeight;
var xCenter = (this.chartProp.chartGutter._left + trueWidth/2) / this.chartProp.pxToMM; var xCenter = (this.chartProp.chartGutter._left + trueWidth/2) / this.chartProp.pxToMM;
var yCenter = (this.chartProp.chartGutter._top + trueHeight/2) / this.chartProp.pxToMM; var yCenter = (this.chartProp.chartGutter._top + trueHeight/2) / this.chartProp.pxToMM;
if(this.chartProp.type == "Radar") if(this.chartProp.type == "Radar")
{ {
var y, x, path; var y, x, path;
//соответствует подписям оси категорий(OX) //соответствует подписям оси категорий(OX)
if(this.chartSpace.chart.plotArea.valAx) if(this.chartSpace.chart.plotArea.valAx)
var yPoints = this.chartSpace.chart.plotArea.valAx.yPoints; var yPoints = this.chartSpace.chart.plotArea.valAx.yPoints;
var numCache = this.chartProp.series[0].val.numRef ? this.chartProp.series[0].val.numRef.numCache.pts : this.chartProp.series[0].val.numLit.pts; var numCache = this.chartProp.series[0].val.numRef ? this.chartProp.series[0].val.numRef.numCache.pts : this.chartProp.series[0].val.numLit.pts;
var tempAngle = 2 * Math.PI / numCache.length; var tempAngle = 2 * Math.PI / numCache.length;
var xDiff = ((trueHeight / 2) / yPoints.length) / this.chartProp.pxToMM; var xDiff = ((trueHeight / 2) / yPoints.length) / this.chartProp.pxToMM;
var radius, xFirst, yFirst; var radius, xFirst, yFirst;
} }
for(var i = 0; i <= this.chartProp.numhlines; i++) for(var i = 0; i <= this.chartProp.numhlines; i++)
{ {
if(this.chartProp.type == "Radar") if(this.chartProp.type == "Radar")
{ {
path = new Path(); path = new Path();
for(var k = 0; k < numCache.length; k++) for(var k = 0; k < numCache.length; k++)
{ {
y = i * xDiff; y = i * xDiff;
x = xCenter; x = xCenter;
radius = y; radius = y;
y = yCenter - radius * Math.cos(k * tempAngle); y = yCenter - radius * Math.cos(k * tempAngle);
x = x + radius * Math.sin(k * tempAngle); x = x + radius * Math.sin(k * tempAngle);
var pathH = this.chartProp.pathH; var pathH = this.chartProp.pathH;
var pathW = this.chartProp.pathW; var pathW = this.chartProp.pathW;
var gdLst = []; var gdLst = [];
path.pathH = pathH; path.pathH = pathH;
path.pathW = pathW; path.pathW = pathW;
gdLst["w"] = 1; gdLst["w"] = 1;
gdLst["h"] = 1; gdLst["h"] = 1;
path.stroke = true; path.stroke = true;
var pxToMm = this.chartProp.pxToMM; var pxToMm = this.chartProp.pxToMM;
if(k == 0) if(k == 0)
{ {
xFirst = x; xFirst = x;
yFirst = y; yFirst = y;
path.moveTo(x * pathW, y * pathH); path.moveTo(x * pathW, y * pathH);
} }
else else
{ {
if(k == numCache.length - 1) if(k == numCache.length - 1)
...@@ -5362,34 +5659,34 @@ gridChart.prototype = ...@@ -5362,34 +5659,34 @@ gridChart.prototype =
} }
else else
path.lnTo(x * pathW, y * pathH); path.lnTo(x * pathW, y * pathH);
} }
} }
path.recalculate(gdLst); path.recalculate(gdLst);
if(!this.paths.horisontalLines) if(!this.paths.horisontalLines)
this.paths.horisontalLines = []; this.paths.horisontalLines = [];
this.paths.horisontalLines[i] = path; this.paths.horisontalLines[i] = path;
} }
else else
{ {
posY = i*stepY + this.chartProp.chartGutter._top; posY = i*stepY + this.chartProp.chartGutter._top;
if(!this.paths.horisontalLines) if(!this.paths.horisontalLines)
this.paths.horisontalLines = []; this.paths.horisontalLines = [];
this.paths.horisontalLines[i] = this._calculateLine(posX, posY, posX + widthLine, posY); this.paths.horisontalLines[i] = this._calculateLine(posX, posY, posX + widthLine, posY);
//промежуточные линии //промежуточные линии
for(var n = 0; n < this.chartProp.numhMinorlines; n++) for(var n = 0; n < this.chartProp.numhMinorlines; n++)
{ {
posMinorY = posY + n*minorStep; posMinorY = posY + n*minorStep;
if(!this.paths.horisontalMinorLines) if(!this.paths.horisontalMinorLines)
this.paths.horisontalMinorLines = []; this.paths.horisontalMinorLines = [];
if(!this.paths.horisontalMinorLines[i]) if(!this.paths.horisontalMinorLines[i])
this.paths.horisontalMinorLines[i] = []; this.paths.horisontalMinorLines[i] = [];
this.paths.horisontalMinorLines[i][n] = this._calculateLine(posX, posMinorY, posX + widthLine, posMinorY); this.paths.horisontalMinorLines[i][n] = this._calculateLine(posX, posMinorY, posX + widthLine, posMinorY);
} }
} }
} }
}, },
......
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