Commit 4bf07dd9 authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix Bug 32148 - Не отображается область 3D диаграммы типа Line, созданной в Libre Office

parent cc884ada
......@@ -2616,7 +2616,7 @@ function drawBarChart()
this.chartProp = null;
this.cChartDrawer = null;
this.cShapeDrawer = null;
this.paths = {};
this.paths = {};
this.sortZIndexPaths = [];
this.summBarVal = [];
}
......@@ -2818,8 +2818,8 @@ drawBarChart.prototype =
if(seria.length)
seriesCounter++;
}
}
if(this.cChartDrawer.nDimensionCount === 3)
{
this.sortZIndexPaths.sort (function sortArr(a, b)
......@@ -3202,7 +3202,7 @@ drawBarChart.prototype =
var isNotDrawDownVerge;
/*if((this.chartProp.subType == "stacked" || this.chartProp.subType == "stackedPer") && val < 0 && (isValMoreZero || (!isValMoreZero && isValLessZero !== 1)))
isNotDrawDownVerge = true;*/
var paths = this.cChartDrawer.calculateRect3D(point1, point2, point3, point4, point5, point6, point7, point8, val, isNotDrawDownVerge);
height = this.chartProp.heightCanvas - this.chartProp.chartGutter._top - this.chartProp.chartGutter._bottom;
......@@ -3638,80 +3638,80 @@ drawLineChart.prototype =
_drawLines3D: function()
{
var t = this;
var drawVerges = function(j, i, onlyLessNull)
{
var brush, pen, seria;
seria = t.chartProp.series[j];
brush = seria.brush;
pen = seria.pen;
if(!(!t.paths.series[j] || !t.paths.series[j][i] || !seria.val.numRef.numCache.pts[i]))
{
if(seria.val.numRef.numCache.pts[i].pen)
pen = seria.val.numRef.numCache.pts[i].pen;
if(seria.val.numRef.numCache.pts[i].brush)
brush = seria.val.numRef.numCache.pts[i].brush;
for(var k = 0; k < t.paths.series[j][i].length; k++)
{
t._drawLine3D(t.paths.series[j][i][k], pen, brush, k);
}
}
};
//рисуем по сериям
var onSeries = function(onlyLessNull)
{
var drawNeedVerge = function()
{
for (var j = 0; j < t.paths.series.length; j++)
{
for (var i = 0; i < t.chartProp.ptCount; i++)
{
drawVerges(j, i, onlyLessNull);
}
}
};
drawNeedVerge();
};
var reverseSeriesOnSeries = function(onlyLessNull)
{
var drawNeedVerge = function()
{
for (var j = t.paths.series.length - 1; j >= 0; j--)
{
if(!t.paths.series)
return;
for (var i = 0; i < t.chartProp.ptCount; i++)
{
drawVerges(j, i, onlyLessNull);
}
}
};
drawNeedVerge();
};
if(!this.cChartDrawer.processor3D.view3D.rAngAx)
{
var angle = Math.abs(this.cChartDrawer.processor3D.angleOy);
if(angle > Math.PI / 2 && angle < 3 * Math.PI / 2)
onSeries();
else
reverseSeriesOnSeries();
}
else
{
reverseSeriesOnSeries();
var t = this;
var drawVerges = function(j, i, onlyLessNull)
{
var brush, pen, seria;
seria = t.chartProp.series[j];
brush = seria.brush;
pen = seria.pen;
if(!(!t.paths.series[j] || !t.paths.series[j][i] || !seria.val.numRef.numCache.pts[i]))
{
if(seria.val.numRef.numCache.pts[i].pen)
pen = seria.val.numRef.numCache.pts[i].pen;
if(seria.val.numRef.numCache.pts[i].brush)
brush = seria.val.numRef.numCache.pts[i].brush;
for(var k = 0; k < t.paths.series[j][i].length; k++)
{
t._drawLine3D(t.paths.series[j][i][k], pen, brush, k);
}
}
};
//рисуем по сериям
var onSeries = function(onlyLessNull)
{
var drawNeedVerge = function()
{
for (var j = 0; j < t.paths.series.length; j++)
{
for (var i = 0; i < t.chartProp.ptCount; i++)
{
drawVerges(j, i, onlyLessNull);
}
}
};
drawNeedVerge();
};
var reverseSeriesOnSeries = function(onlyLessNull)
{
var drawNeedVerge = function()
{
for (var j = t.paths.series.length - 1; j >= 0; j--)
{
if(!t.paths.series)
return;
for (var i = 0; i < t.chartProp.ptCount; i++)
{
drawVerges(j, i, onlyLessNull);
}
}
};
drawNeedVerge();
};
if(!this.cChartDrawer.processor3D.view3D.rAngAx)
{
var angle = Math.abs(this.cChartDrawer.processor3D.angleOy);
if(angle > Math.PI / 2 && angle < 3 * Math.PI / 2)
onSeries();
else
reverseSeriesOnSeries();
}
else
{
reverseSeriesOnSeries();
}
},
......@@ -3721,7 +3721,7 @@ drawLineChart.prototype =
//в excel всегда темные боковые стороны, лицевая и задняя стороны светлые
//todo возможно стоит проверить fill.type на FILL_TYPE_NOFILL и рисовать отдельно границы, если они заданы!
brush = pen.Fill;
//brush = pen.Fill;
if(brush.fill.color === undefined)
return;
......
......@@ -5910,6 +5910,13 @@ CChartSpace.prototype =
case historyitem_type_ScatterSer:
case historyitem_type_SurfaceSeries:
{
if(this.chart.view3D)
{
union_marker.marker = CreateMarkerGeometryByType(SYMBOL_SQUARE, null);
union_marker.marker.pen = ser.compiledSeriesPen;
union_marker.marker.brush = ser.compiledSeriesBrush;
break;
}
if(ser.compiledSeriesMarker)
{
union_marker.marker = CreateMarkerGeometryByType(ser.compiledSeriesMarker.symbol, null);
......@@ -5926,7 +5933,7 @@ CChartSpace.prototype =
union_marker.lineMarker = CreateMarkerGeometryByType(SYMBOL_DASH, null);
union_marker.lineMarker.pen = ser.compiledSeriesPen.createDuplicate(); //Копируем, так как потом возможно придется изменять толщину линии;
}
if(!b_scatter_no_line)
if(!b_scatter_no_line && !this.chart.view3D)
b_line_series = true;
break;
}
......@@ -5980,7 +5987,7 @@ CChartSpace.prototype =
calc_entry.calcMarkerUnion = new CUnionMarker();
union_marker = calc_entry.calcMarkerUnion;
if(ser.getObjectType() === historyitem_type_LineSeries || ser.getObjectType() === historyitem_type_ScatterSer)
if(ser.getObjectType() === historyitem_type_LineSeries && !this.chart.view3D || ser.getObjectType() === historyitem_type_ScatterSer)
{
if(pt.compiledMarker)
{
......@@ -5993,7 +6000,7 @@ CChartSpace.prototype =
union_marker.lineMarker = CreateMarkerGeometryByType(SYMBOL_DASH, null);
union_marker.lineMarker.pen = pt.pen;
}
if(!b_scatter_no_line)
if(!b_scatter_no_line && this.chart.view3D)
b_line_series = true;
}
else
......@@ -7153,7 +7160,7 @@ CChartSpace.prototype =
{
var plot_area = this.chart.plotArea;
var default_brush;
if(this.chart.view3D && this.chart.view3D.rAngAx)
if(this.chart.view3D)
{
default_brush = CreateNoFillUniFill();
}
......@@ -7555,49 +7562,170 @@ CChartSpace.prototype =
case historyitem_type_RadarChart:
{
var base_line_fills = getArrayFillsFromBase(style.line4, getMaxIdx(series));
for(var i = 0; i < series.length; ++i)
if(!this.chart.view3D)
{
var default_line = parents.theme.themeElements.fmtScheme.lnStyleLst[0];
var ser = series[i];
var pts = getPtsFromSeries(ser);
var compiled_line = new CLn();
compiled_line.merge(default_line);
compiled_line.Fill.merge(base_line_fills[ser.idx]);
compiled_line.w *= style.line3;
if(ser.spPr && ser.spPr.ln)
compiled_line.merge(ser.spPr.ln);
ser.compiledSeriesPen = compiled_line.createDuplicate();
for(var j = 0; j < pts.length; ++j)
for(var i = 0; i < series.length; ++i)
{
var default_line = parents.theme.themeElements.fmtScheme.lnStyleLst[0];
var ser = series[i];
var pts = getPtsFromSeries(ser);
var compiled_line = new CLn();
compiled_line.merge(default_line);
compiled_line.Fill.merge(base_line_fills[ser.idx]);
compiled_line.w *= style.line3;
if(ser.spPr && ser.spPr.ln)
compiled_line.merge(ser.spPr.ln);
if(Array.isArray(ser.dPt))
ser.compiledSeriesPen = compiled_line.createDuplicate();
for(var j = 0; j < pts.length; ++j)
{
for(var k = 0; k < ser.dPt.length; ++k)
var compiled_line = new CLn();
compiled_line.merge(default_line);
compiled_line.Fill.merge(base_line_fills[ser.idx]);
compiled_line.w *= style.line3;
if(ser.spPr && ser.spPr.ln)
compiled_line.merge(ser.spPr.ln);
if(Array.isArray(ser.dPt))
{
if(ser.dPt[k].idx === pts[j].idx)
for(var k = 0; k < ser.dPt.length; ++k)
{
if(ser.dPt[k].spPr)
if(ser.dPt[k].idx === pts[j].idx)
{
compiled_line.merge(ser.dPt[k].spPr.ln);
if(ser.dPt[k].spPr)
{
compiled_line.merge(ser.dPt[k].spPr.ln);
}
break;
}
break;
}
}
pts[j].brush = null;
pts[j].pen = compiled_line;
pts[j].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
if(pts[j].compiledMarker)
{
pts[j].compiledMarker.pen && pts[j].compiledMarker.pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
pts[j].compiledMarker.brush && pts[j].compiledMarker.brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
}
pts[j].brush = null;
pts[j].pen = compiled_line;
pts[j].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
if(pts[j].compiledMarker)
}
}
else
{
var base_fills = getArrayFillsFromBase(style.fill2, getMaxIdx(series));
var base_line_fills = null;
if(style.line1 === EFFECT_SUBTLE && this.style === 34)
base_line_fills = getArrayFillsFromBase(style.line2, getMaxIdx(series));
for(var i = 0; i < series.length; ++i)
{
var ser = series[i];
var compiled_brush = new CUniFill();
compiled_brush.merge(base_fills[ser.idx]);
if(ser.spPr && ser.spPr.Fill)
{
compiled_brush.merge(ser.spPr.Fill);
}
ser.compiledSeriesBrush = compiled_brush.createDuplicate();
var pts = getPtsFromSeries(ser);
for(var j = 0; j < pts.length; ++j)
{
var compiled_brush = new CUniFill();
compiled_brush.merge(base_fills[ser.idx]);
if(ser.spPr && ser.spPr.Fill)
{
compiled_brush.merge(ser.spPr.Fill);
}
if(Array.isArray(ser.dPt) && !(ser.getObjectType && ser.getObjectType() === historyitem_type_AreaSeries))
{
for(var k = 0; k < ser.dPt.length; ++k)
{
if(ser.dPt[k].idx === pts[j].idx)
{
if(ser.dPt[k].spPr)
{
compiled_brush.merge(ser.dPt[k].spPr.Fill);
}
break;
}
}
}
pts[j].brush = compiled_brush;
pts[j].brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
//
{
default_line = new CLn();
if(style.line1 === EFFECT_NONE)
{
default_line.w = 0;
}
else if(style.line1 === EFFECT_SUBTLE)
{
default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[0]);
}
else if(style.line1 === EFFECT_MODERATE)
{
default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[1]);
}
else if(style.line1 === EFFECT_INTENSE)
{
default_line.merge(parents.theme.themeElements.fmtScheme.lnStyleLst[2]);
}
var base_line_fills;
if(this.style === 34)
base_line_fills = getArrayFillsFromBase(style.line2, getMaxIdx(pts));
pts[j].compiledMarker.pen && pts[j].compiledMarker.pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
pts[j].compiledMarker.brush && pts[j].compiledMarker.brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
var compiled_line = new CLn();
compiled_line.merge(default_line);
compiled_line.Fill = new CUniFill();
if(this.style !== 34)
compiled_line.Fill.merge(style.line2[0]);
else
compiled_line.Fill.merge(base_line_fills[ser.idx]);
if(ser.spPr && ser.spPr.ln)
{
compiled_line.merge(ser.spPr.ln);
}
ser.compiledSeriesPen = compiled_line.createDuplicate();
for(var j = 0; j < pts.length; ++j)
{
var compiled_line = new CLn();
compiled_line.merge(default_line);
compiled_line.Fill = new CUniFill();
if(this.style !== 34)
compiled_line.Fill.merge(style.line2[0]);
else
compiled_line.Fill.merge(base_line_fills[ser.idx]);
if(ser.spPr && ser.spPr.ln)
{
compiled_line.merge(ser.spPr.ln);
}
if(Array.isArray(ser.dPt) && !(ser.getObjectType && ser.getObjectType() === historyitem_type_AreaSeries))
{
for(var k = 0; k < ser.dPt.length; ++k)
{
if(ser.dPt[k].idx === pts[j].idx)
{
if(ser.dPt[k].spPr)
{
compiled_line.merge(ser.dPt[k].spPr.ln);
}
break;
}
}
}
pts[j].pen = compiled_line;
pts[j].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
if(pts[j].compiledMarker)
{
pts[j].compiledMarker.pen && pts[j].compiledMarker.pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
pts[j].compiledMarker.brush && pts[j].compiledMarker.brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
}
}
}
}
......@@ -8142,10 +8270,33 @@ CChartSpace.prototype =
if(this.chart.plotArea.chart.getAxisByTypes)
{
var axis_by_types = this.chart.plotArea.chart.getAxisByTypes();
if(axis_by_types.valAx.length === 1 && axis_by_types.catAx.length === 1)
if(axis_by_types.valAx.length > 0 && axis_by_types.catAx.length > 0)
{
this.chart.plotArea.valAx = axis_by_types.valAx[0];
this.chart.plotArea.catAx = axis_by_types.catAx[0];
for(var i = 0; i < axis_by_types.valAx.length; ++i)
{
if(axis_by_types.valAx[i].crossAx)
{
for(var j = 0; j < axis_by_types.catAx.length; ++j)
{
if(axis_by_types.catAx[j] === axis_by_types.valAx[i].crossAx)
{
this.chart.plotArea.valAx = axis_by_types.valAx[i];
this.chart.plotArea.catAx = axis_by_types.catAx[j];
break;
}
}
if(j < axis_by_types.catAx.length)
{
break;
}
}
}
if(i === axis_by_types.valAx.length)
{
this.chart.plotArea.valAx = axis_by_types.valAx[0];
this.chart.plotArea.catAx = axis_by_types.catAx[0];
}
}
else
{
......
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