Commit 3cf66598 authored by GoshaZotov's avatar GoshaZotov

changes for normal area charts

parent 75d7220c
...@@ -902,14 +902,16 @@ Processor3D.prototype._calculateDepthPerspective = function() ...@@ -902,14 +902,16 @@ Processor3D.prototype._calculateDepthPerspective = function()
var width = widthChart / this.chartsDrawer.calcProp.ptCount; var width = widthChart / this.chartsDrawer.calcProp.ptCount;
var defaultOverlap = (this.chartsDrawer.calcProp.subType == "stacked" || this.chartsDrawer.calcProp.subType == "stackedPer" || this.chartsDrawer.calcProp.subType == "standard" || this.chartsDrawer.calcProp.type == AscFormat.c_oChartTypes.Line) ? 100 : 0; var isNormalArea = !!(this.chartsDrawer.calcProp.subType == "normal" && this.chartsDrawer.calcProp.type == AscFormat.c_oChartTypes.Area);
var defaultOverlap = (this.chartsDrawer.calcProp.subType == "stacked" || this.chartsDrawer.calcProp.subType == "stackedPer" || this.chartsDrawer.calcProp.subType == "standard" || this.chartsDrawer.calcProp.type == AscFormat.c_oChartTypes.Line || isNormalArea) ? 100 : 0;
var overlap = this.chartSpace.chart.plotArea.chart.overlap ? (this.chartSpace.chart.plotArea.chart.overlap / 100) : (defaultOverlap / 100); var overlap = this.chartSpace.chart.plotArea.chart.overlap ? (this.chartSpace.chart.plotArea.chart.overlap / 100) : (defaultOverlap / 100);
var gapWidth = this.chartSpace.chart.plotArea.chart.gapWidth != null ? (this.chartSpace.chart.plotArea.chart.gapWidth / 100) : (150 / 100); var gapWidth = this.chartSpace.chart.plotArea.chart.gapWidth != null ? (this.chartSpace.chart.plotArea.chart.gapWidth / 100) : (150 / 100);
var gapDepth = this.chartSpace.chart.plotArea.chart.gapDepth != null ? (this.chartSpace.chart.plotArea.chart.gapDepth / 100) : (150 / 100); var gapDepth = this.chartSpace.chart.plotArea.chart.gapDepth != null ? (this.chartSpace.chart.plotArea.chart.gapDepth / 100) : (150 / 100);
var baseDepth = width / (seriesCount - (seriesCount - 1) * overlap + gapWidth); var baseDepth = width / (seriesCount - (seriesCount - 1) * overlap + gapWidth);
if(this.chartsDrawer.calcProp.subType == "standard" || this.chartsDrawer.calcProp.type == AscFormat.c_oChartTypes.Line) if(this.chartsDrawer.calcProp.subType == "standard" || this.chartsDrawer.calcProp.type == AscFormat.c_oChartTypes.Line || isNormalArea)
baseDepth = (width / (seriesCount - (seriesCount - 1) * overlap + gapWidth)) * seriesCount; baseDepth = (width / (seriesCount - (seriesCount - 1) * overlap + gapWidth)) * seriesCount;
//процент от базовой глубины //процент от базовой глубины
...@@ -923,7 +925,7 @@ Processor3D.prototype._calculateDepthPerspective = function() ...@@ -923,7 +925,7 @@ Processor3D.prototype._calculateDepthPerspective = function()
} }
//TODO глубина в некоторых случаях отличается(тип Standard) //TODO глубина в некоторых случаях отличается(тип Standard)
if(this.chartsDrawer.calcProp.subType === "standard" || this.chartsDrawer.calcProp.type === AscFormat.c_oChartTypes.Line) if(this.chartsDrawer.calcProp.subType === "standard" || this.chartsDrawer.calcProp.type === AscFormat.c_oChartTypes.Line || isNormalArea)
{ {
var b = 1 / seriesCount; var b = 1 / seriesCount;
...@@ -940,7 +942,7 @@ Processor3D.prototype._calculateDepthPerspective = function() ...@@ -940,7 +942,7 @@ Processor3D.prototype._calculateDepthPerspective = function()
Processor3D.prototype._calcSpecialStandardScaleX = function() Processor3D.prototype._calcSpecialStandardScaleX = function()
{ {
if(!(this.chartsDrawer.calcProp.subType == "standard" || this.chartsDrawer.calcProp.type == AscFormat.c_oChartTypes.Line)) if(!(this.chartsDrawer.calcProp.subType == "standard" || this.chartsDrawer.calcProp.type == AscFormat.c_oChartTypes.Line || (this.chartsDrawer.calcProp.type === AscFormat.c_oChartTypes.Area && this.chartsDrawer.calcProp.subType == "normal")))
return; return;
//calculate width in 3d standard charts with rAngAx //calculate width in 3d standard charts with rAngAx
...@@ -2226,13 +2228,13 @@ Processor3D.prototype._calcAspectRatio = function() ...@@ -2226,13 +2228,13 @@ Processor3D.prototype._calcAspectRatio = function()
var aspectRatioY = 1; var aspectRatioY = 1;
var subType = this.chartsDrawer.calcProp.subType; var subType = this.chartsDrawer.calcProp.subType;
if((subType === "standard" || this.chartsDrawer.calcProp.type === AscFormat.c_oChartTypes.Line) && !this.view3D.rAngAx) if((subType === "standard" || this.chartsDrawer.calcProp.type === AscFormat.c_oChartTypes.Line || (this.chartsDrawer.calcProp.type === AscFormat.c_oChartTypes.Area && subType == "normal")) && !this.view3D.rAngAx)
{ {
this._calcSpecialStandardScaleX(); this._calcSpecialStandardScaleX();
aspectRatioX = (widthOriginalChart / (heightOriginalChart / hPercent)) * this.specialStandardScaleX; aspectRatioX = (widthOriginalChart / (heightOriginalChart / hPercent)) * this.specialStandardScaleX;
} }
else if(subType === "standard" || this.chartsDrawer.calcProp.type === AscFormat.c_oChartTypes.Line || (this.chartsDrawer.calcProp.type === AscFormat.c_oChartTypes.Area && subType == "normal")) else if(subType === "standard" || this.chartsDrawer.calcProp.type === AscFormat.c_oChartTypes.Line)
{ {
var seriesCount = this.chartsDrawer.calcProp.seriesCount; var seriesCount = this.chartsDrawer.calcProp.seriesCount;
var ptCount = this.chartsDrawer.calcProp.ptCount; var ptCount = this.chartsDrawer.calcProp.ptCount;
......
This diff is collapsed.
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