Commit 995febc7 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@54139 954022d7-b5bf-4e40-9824-e11837661b57
parent a5dd5a4e
...@@ -7,7 +7,7 @@ function CChartsDrawer() ...@@ -7,7 +7,7 @@ function CChartsDrawer()
this.calcProp = null; this.calcProp = null;
this.areaChart = null; this.allAreaChart = null;
this.gridChart = null; this.gridChart = null;
this.chart = null; this.chart = null;
} }
...@@ -19,6 +19,9 @@ CChartsDrawer.prototype = ...@@ -19,6 +19,9 @@ CChartsDrawer.prototype =
this.calcProp = {}; this.calcProp = {};
this._calculateProperties(chartProp); this._calculateProperties(chartProp);
//создаём область
this.allAreaChart = new allAreaChart();
//создаём область //создаём область
this.areaChart = new areaChart(); this.areaChart = new areaChart();
...@@ -67,8 +70,9 @@ CChartsDrawer.prototype = ...@@ -67,8 +70,9 @@ CChartsDrawer.prototype =
this.chart = newChart; this.chart = newChart;
//делаем полный пресчёт //делаем полный пресчёт
this.areaChart.reCalculate(this.calcProp, null, this);
this.gridChart.reCalculate(this.calcProp, null, this); this.gridChart.reCalculate(this.calcProp, null, this);
this.areaChart.reCalculate(this.calcProp); this.allAreaChart.reCalculate(this.calcProp);
this.chart.reCalculate(this, chartProp); this.chart.reCalculate(this, chartProp);
}, },
...@@ -79,6 +83,7 @@ CChartsDrawer.prototype = ...@@ -79,6 +83,7 @@ CChartsDrawer.prototype =
this.calcProp.series = chartProp.chart.plotArea.chart.series; this.calcProp.series = chartProp.chart.plotArea.chart.series;
//отрисовываем без пересчёта //отрисовываем без пересчёта
this.allAreaChart.draw(this.calcProp, cShapeDrawer);
this.areaChart.draw(this.calcProp, cShapeDrawer); this.areaChart.draw(this.calcProp, cShapeDrawer);
this.gridChart.draw(this.calcProp, cShapeDrawer, chartProp); this.gridChart.draw(this.calcProp, cShapeDrawer, chartProp);
this.chart.draw(this, cShapeDrawer, chartProp); this.chart.draw(this, cShapeDrawer, chartProp);
...@@ -3627,7 +3632,6 @@ drawScatterChart.prototype = ...@@ -3627,7 +3632,6 @@ drawScatterChart.prototype =
} }
case DLBL_POS_BEST_FIT: case DLBL_POS_BEST_FIT:
{ {
//centerY = centerY + 27 / pxToMm;
break; break;
} }
case DLBL_POS_CTR: case DLBL_POS_CTR:
...@@ -3864,15 +3868,15 @@ gridChart.prototype = ...@@ -3864,15 +3868,15 @@ gridChart.prototype =
//*****Area of chart***** //*****all area of chart*****
function areaChart() function allAreaChart()
{ {
this.chartProp = null; this.chartProp = null;
this.cShapeDrawer = null; this.cShapeDrawer = null;
this.paths = null; this.paths = null;
} }
areaChart.prototype = allAreaChart.prototype =
{ {
draw : function(chartProp, cShapeDrawer) draw : function(chartProp, cShapeDrawer)
{ {
...@@ -3928,7 +3932,7 @@ areaChart.prototype = ...@@ -3928,7 +3932,7 @@ areaChart.prototype =
this._drawPath(this.paths, lineWidth, StrokeUniColor, FillUniColor); this._drawPath(this.paths, lineWidth, StrokeUniColor, FillUniColor);
}, },
_drawPath: function(path, lineWidth,StrokeUniColor, FillUniColor) _drawPath: function(path, lineWidth, StrokeUniColor, FillUniColor)
{ {
if(StrokeUniColor) if(StrokeUniColor)
{ {
...@@ -3946,6 +3950,95 @@ areaChart.prototype = ...@@ -3946,6 +3950,95 @@ areaChart.prototype =
} }
} }
//*****Area of chart*****
function areaChart()
{
this.chartProp = null;
this.cShapeDrawer = null;
this.paths = null;
}
areaChart.prototype =
{
draw : function(chartProp, cShapeDrawer)
{
this.chartProp = chartProp;
this.cShapeDrawer = cShapeDrawer;
this._drawArea();
},
reCalculate: function(chartProp, cShapeDrawer)
{
this.chartProp = chartProp;
this.cShapeDrawer = cShapeDrawer;
this.paths = null;
this._calculateArea();
},
_calculateArea: function()
{
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;
var pxToMm = this.chartProp.pxToMM;
var widthGraph = this.chartProp.widthCanvas;
var heightGraph = this.chartProp.heightCanvas;
var leftMargin = this.chartProp.chartGutter._left;
var rightMargin = this.chartProp.chartGutter._right;
var topMargin = this.chartProp.chartGutter._top;
var bottomMargin = this.chartProp.chartGutter._bottom;
path.moveTo(leftMargin / pxToMm * pathW, (heightGraph - bottomMargin) / pxToMm * pathH);
path.lnTo((widthGraph - rightMargin) / pxToMm * pathW, (heightGraph - bottomMargin) / pxToMm * pathH);
path.lnTo((widthGraph - rightMargin) / pxToMm * pathW, topMargin / pxToMm * pathH);
path.lnTo(leftMargin / pxToMm * pathW, topMargin / pxToMm * pathH);
path.moveTo(leftMargin / pxToMm * pathW, (heightGraph - bottomMargin) / pxToMm * pathH);
path.recalculate(gdLst);
this.paths = path;
},
_drawArea: function()
{
var StrokeUniColor = new CUniColor().RGBA;
var FillUniColor = new CUniColor().RGBA;
FillUniColor.R = 255;
FillUniColor.G = 255;
FillUniColor.B = 255;
var lineWidth = 1;
this._drawPath(this.paths, lineWidth, StrokeUniColor, FillUniColor);
},
_drawPath: function(path, lineWidth, StrokeUniColor, FillUniColor)
{
if(StrokeUniColor)
{
path.stroke = true;
this.cShapeDrawer.StrokeWidth = lineWidth/(96/25.4);
this.cShapeDrawer.p_width(1000 * this.cShapeDrawer.StrokeWidth);
this.cShapeDrawer.StrokeUniColor = StrokeUniColor;
}
this.cShapeDrawer.FillUniColor = FillUniColor;
var cGeometry = new CGeometry2();
cGeometry.AddPath(path);
this.cShapeDrawer.draw(cGeometry);
}
}
//****another functions and classes*** //****another functions and classes***
function CGeometry2() function CGeometry2()
......
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