Commit 868513b4 authored by GoshaZotov's avatar GoshaZotov

+ previous revision

parent 5d829dce
...@@ -8081,15 +8081,12 @@ drawPieChart.prototype = ...@@ -8081,15 +8081,12 @@ drawPieChart.prototype =
var swapAngle = Math.abs((parseFloat(partOfSum)) * (Math.PI * 2)); var swapAngle = Math.abs((parseFloat(partOfSum)) * (Math.PI * 2));
if(!this.paths.series) if(!this.paths.series)
this.paths.series = [];
if(sumData === 0)//TODO стоит пересмотреть
{ {
this.paths.series[i] = this._calculateEmptySegment(radius, xCenter, yCenter); this.paths.series = [];
} }
else
{
this.paths.series[i] = this._calculateSegment3D(startAngle, swapAngle, radius, xCenter, yCenter); this.paths.series[i] = this._calculateSegment3D(startAngle, swapAngle, radius, xCenter, yCenter);
}
startAngle += swapAngle; startAngle += swapAngle;
} }
}, },
...@@ -8243,6 +8240,23 @@ drawPieChart.prototype = ...@@ -8243,6 +8240,23 @@ drawPieChart.prototype =
path.recalculate(gdLst); path.recalculate(gdLst);
return path;
};
var calculateDownFace = function(startAng, swapAng)
{
var path = getNewPath();
var endAng = startAng + swapAng;
var p = getSegmentPoints(startAng, endAng);
path.moveTo(xCenter / pxToMm * pathW, (yCenter + depth) / pxToMm * pathH);
path.lnTo(p.x0 / pxToMm * pathW, (p.y0 + depth) / pxToMm * pathH);
path.arcTo(radius1 / pxToMm * pathW, radius2 / pxToMm * pathH, -1 * stAng*cToDeg, -1 * swapAng*cToDeg);
path.lnTo(xCenter /pxToMm * pathW, (yCenter + depth) / pxToMm * pathH);
path.recalculate(gdLst);
return path; return path;
} }
...@@ -8268,9 +8282,12 @@ drawPieChart.prototype = ...@@ -8268,9 +8282,12 @@ drawPieChart.prototype =
//UP FACE //UP FACE
var upPath = calculateUpFace(stAng, swAng); var upPath = calculateUpFace(stAng, swAng);
//DOWN FACE
var downPath = calculateDownFace(stAng, swAng);
this.angleFor3D += swAng; this.angleFor3D += swAng;
return {frontPath: frontPath, upPath: upPath, insidePath: insidePath}; return {frontPath: frontPath, upPath: upPath, insidePath: insidePath, downPath: downPath};
}, },
_calculateSegment3D: function (startAngle, swapAngle, radius, xCenter, yCenter) _calculateSegment3D: function (startAngle, swapAngle, radius, xCenter, yCenter)
...@@ -8302,6 +8319,8 @@ drawPieChart.prototype = ...@@ -8302,6 +8319,8 @@ drawPieChart.prototype =
var drawPath = function(path, pen, brush, isShadePen, isShadeBrush) var drawPath = function(path, pen, brush, isShadePen, isShadeBrush)
{ {
if(path) if(path)
{
if(brush)
{ {
var props = t.cChartSpace.getParentObjects(); var props = t.cChartSpace.getParentObjects();
var duplicateBrush = brush.createDuplicate(); var duplicateBrush = brush.createDuplicate();
...@@ -8310,9 +8329,9 @@ drawPieChart.prototype = ...@@ -8310,9 +8329,9 @@ drawPieChart.prototype =
cColorMod.val = shadeValue; cColorMod.val = shadeValue;
cColorMod.name = shade; cColorMod.name = shade;
if(duplicateBrush.fill.color) if(duplicateBrush)
{ {
duplicateBrush.fill.color.Mods.addMod(cColorMod); duplicateBrush.addColorMod(cColorMod);
duplicateBrush.calculate(props.theme, props.slide, props.layout, props.master, new AscFormat.CUniColor().RGBA); duplicateBrush.calculate(props.theme, props.slide, props.layout, props.master, new AscFormat.CUniColor().RGBA);
} }
if(isShadePen) if(isShadePen)
...@@ -8323,12 +8342,30 @@ drawPieChart.prototype = ...@@ -8323,12 +8342,30 @@ drawPieChart.prototype =
{ {
brush = duplicateBrush; brush = duplicateBrush;
} }
}
t.cChartDrawer.drawPath(path, pen, brush); t.cChartDrawer.drawPath(path, pen, brush);
} }
}; };
//DOWN
for (var i = 0,len = numCache.length; i < len; i++)
{
var val = numCache[i];
var brush = val.brush;
var pen = val.pen;
var path = this.paths.series[i];
if(path)
{
for(var j = path.length - 1; j >= 0; j--)
{
drawPath(path[j].downPath, pen, null);
}
}
}
//INSIDE //INSIDE
for (var i = 0,len = numCache.length; i < len; i++) for (var i = 0,len = numCache.length; i < len; i++)
{ {
......
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