Commit 98152bce authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53734 954022d7-b5bf-4e40-9824-e11837661b57
parent 563e604e
...@@ -418,7 +418,7 @@ CChartSpace.prototype.recalculateMarkers = function() ...@@ -418,7 +418,7 @@ CChartSpace.prototype.recalculateMarkers = function()
var RGBA = {R:0, G:0, B:0, A: 255}; var RGBA = {R:0, G:0, B:0, A: 255};
if(this.chart.plotArea.chart.varyColors && this.chart.plotArea.chart.series.length === 1) if(this.chart.plotArea.chart.varyColors && this.chart.plotArea.chart.series.length === 1)
{ {
var ser = this.chart.plotArea.chart.series; var ser = this.chart.plotArea.chart.series[0];
if(ser.val) if(ser.val)
{ {
pts = ser.val.numRef.numCache.pts; pts = ser.val.numRef.numCache.pts;
...@@ -534,164 +534,323 @@ CChartSpace.prototype.recalculateSeriesColors = function() ...@@ -534,164 +534,323 @@ CChartSpace.prototype.recalculateSeriesColors = function()
{ {
if(this.chart && this.chart.plotArea && this.chart.plotArea.chart && this.chart.plotArea.chart.series) if(this.chart && this.chart.plotArea && this.chart.plotArea.chart && this.chart.plotArea.chart.series)
{ {
var style = CHART_STYLE_MANAGER.getStyleByIndex(this.style);
var series = this.chart.plotArea.chart.series; var series = this.chart.plotArea.chart.series;
var arrayColors = [];
var countBase = this.baseColors.length;
var need_colors = this.getNeedColorCount();
var needCreate = parseInt(need_colors / countBase) + 1;
for (var i = 0; i < needCreate; i++) var parents = this.getParentObjects();
var RGBA = {R: 0, G: 0, B: 0, A: 255};
if(this.chart.plotArea.chart.varyColors && series.length === 1 || this.chart.plotArea.chart instanceof CPieChart)
{ {
for (var j = 0; j < countBase; j++) var pts;
var ser = series[0];
if(ser.val)
{ {
var percent = (-70 + 140 * ( (i + 1) / (needCreate + 1) )) * 1000; pts = ser.val.numRef.numCache.pts;
var color = CreateUniFillSolidFillWidthTintOrShade(this.baseColors[j], 100000 - percent);
arrayColors.push( color );
} }
else if(ser.yVal)
{
pts = ser.yVal.numRef.numCache.pts;
}
else
{
pts = [];
} }
arrayColors.splice(need_colors, arrayColors.length - need_colors);
var RGBA = {R: 0, G: 0, B: 0, A:255};
var parents = this.getParentObjects();
var b_vary_colors = this.chart.plotArea.chart instanceof CPieChart || (this.chart.plotArea.chart.varyColors && this.chart.plotArea.chart.series.length === 1);
var parents = this.getParentObjects();
for(var i = 0; i < series.length; ++i) if(!(this.chart.plotArea.chart instanceof CLineChart))
{ {
var ser = series[i]; var base_fills = getArrayFillsFromBase(style.fill2, pts.length);
if(!(this.chart.plotArea.chart instanceof CPieChart)) for(var i = 0; i < pts.length; ++i)
{ {
ser.brush = null; var compiled_brush = new CUniFill();
ser.pen = null; compiled_brush.merge(base_fills[i]);
if(ser.spPr && ser.spPr.Fill) if(ser.spPr && ser.spPr.Fill)
{ {
ser.brush = ser.spPr.Fill; compiled_brush.merge(ser.spPr.Fill);
} }
else if(Array.isArray(ser.dPt))
{
for(var j = 0; j < ser.dPt.length; ++j)
{ {
ser.brush = arrayColors[i]; if(ser.dPt[j].idx === pts[i].idx)
{
if(ser.dPt[j].spPr)
{
compiled_brush.merge(ser.dPt[j].spPr.Fill);
}
break;
} }
}
}
pts[i].brush = compiled_brush;
pts[i].brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
if(style.line1 === EFFECT_SUBTLE)
{
var default_line = parents.theme.themeElements.fmtScheme.lnStyleLst[0];
ser.pen = null; var base_line_fills = [];
if(ser.spPr && ser.spPr.ln) if(this.style !== 34)
{ {
ser.pen = ser.spPr.ln; for(i = 0; i < pts.length; ++i)
ser.pen = ser.spPr.ln.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA); {
var compiled_line = new CLn();
compiled_line.merge(default_line);
compiled_line.Fill.merge(style.line2[0]);
if(ser.spPr && spPr.ln)
{
compiled_line.merge(spPr.ln);
} }
else if(Array.isArray(ser.dPt))
{ {
if(ser instanceof CLineSeries) for(var j = 0; j < ser.dPt.length; ++j)
{ {
ser.pen = new CLn(); if(ser.dPt[j].idx === pts[i].idx)
ser.pen.setFill(arrayColors[i]); {
ser.pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA); if(ser.dPt[j].spPr)
{
compiled_line.merge(ser.dPt[j].spPr.ln);
} }
break;
} }
ser.brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA); }
if(ser.val && ser.val.numRef && ser.val.numRef.numCache && ser.val.numRef.numCache.pts) }
pts[i].pen = compiled_line;
pts[i].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
}
else
{ {
var pts = ser.val.numRef.numCache.pts; var base_line_fills = getArrayFillsFromBase(style.line2, pts.length);
for(var j = 0; j < pts.length; ++j) for(i = 0; i < pts.length; ++i)
{
var compiled_line = new CLn();
compiled_line.merge(default_line);
compiled_line.Fill.merge(base_line_fills[i]);
if(ser.spPr && spPr.ln)
{ {
pts[j].brush = ser.brush; compiled_line.merge(spPr.ln);
pts[j].pen = ser.pen;
} }
if(Array.isArray(ser.dPt)) if(Array.isArray(ser.dPt))
{ {
for(j = 0; j < ser.dPt.length; ++j) for(var j = 0; j < ser.dPt.length; ++j)
{
if(ser.dPt[j].idx === pts[i].idx)
{
if(ser.dPt[j].spPr)
{
compiled_line.merge(ser.dPt[j].spPr.ln);
}
break;
}
}
}
pts[i].pen = compiled_line;
pts[i].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
}
}
}
else
{
var default_line = parents.theme.themeElements.fmtScheme.lnStyleLst[0];
var base_line_fills = getArrayFillsFromBase(style.line4, pts.length);
for(var i = 0; i < pts.length; ++i)
{ {
if(ser.dPt[j].spPr && ser.dpt.spPr.Fill) var compiled_line = new CLn();
compiled_line.merge(default_line);
compiled_line.Fill.merge(base_line_fills[i]);
compiled_line.w *= style.line3;
if(ser.spPr && spPr.ln)
{ {
pts[ser.dpt.idx].brush = ser.dpt.spPr.Fill; compiled_line.merge(spPr.ln);
pts[ser.dpt.idx].brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
} }
if(ser.dPt[j].spPr && ser.dpt.spPr.ln) if(Array.isArray(ser.dPt))
{
for(var j = 0; j < ser.dPt.length; ++j)
{
if(ser.dPt[j].idx === pts[i].idx)
{ {
pts[ser.dpt.idx].pen = ser.dpt.spPr.pen; if(ser.dPt[j].spPr)
pts[ser.dpt.idx].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA); {
compiled_line.merge(ser.dPt[j].spPr.ln);
}
break;
}
}
} }
pts[i].brush = null;
pts[i].pen = compiled_line;
pts[i].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
} }
} }
} }
if(ser.yVal && ser.yVal.numRef && ser.yVal.numRef.numCache && ser.yVal.numRef.numCache.pts)//Точечная диаграмма else
{
if(!(this.chart.plotArea.chart instanceof CLineChart))
{
var base_fills = getArrayFillsFromBase(style.fill2, series.length);
var base_line_fills = null;
if(style.line1 === EFFECT_SUBTLE && this.style === 34)
base_line_fills = getArrayFillsFromBase(style.line2, series.length);
for(var i = 0; i < series.length; ++i)
{ {
var ptsY = ser.yVal.numRef.numCache.pts; var ser = series[i];
var ptsX; var pts;
if(ser.xVal && ser.xVal.numRef && ser.xVal.numRef.numCache && ser.xVal.numRef.numCache.pts) if(ser.val)
{
pts = ser.val.numRef.numCache.pts;
}
else if(ser.yVal)
{ {
ptsX = ser.xVal.numRef.numCache.pts; pts = ser.yVal.numRef.numCache.pts;
} }
else else
{ {
ptsX = null; pts = [];
} }
if(Array.isArray(ptsX)) for(var j = 0; j < pts.length; ++j)
{
var compiled_brush = new CUniFill();
compiled_brush.merge(base_fills[i]);
if(ser.spPr && ser.spPr.Fill)
{
compiled_brush.merge(ser.spPr.Fill);
}
if(Array.isArray(ser.dPt))
{
for(var k = 0; k < ser.dPt.length; ++k)
{
if(ser.dPt[k].idx === pts[j].idx)
{ {
for(var j = 0; j < ptsX.length; ++j) if(ser.dPt[k].spPr)
{ {
ptsX[j].brush = ser.brush; compiled_brush.merge(ser.dPt[k].spPr.Fill);
ptsX[j].pen = ser.pen; }
break;
} }
} }
for(var j = 0; j < ptsY.length; ++j) }
pts[j].brush = compiled_brush;
pts[j].brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
if(style.line1 === EFFECT_SUBTLE)
{
var default_line = parents.theme.themeElements.fmtScheme.lnStyleLst[0];
if(this.style !== 34)
{
for(var j = 0; j < pts.length; ++j)
{
var compiled_line = new CLn();
compiled_line.merge(default_line);
compiled_line.Fill.merge(style.line2[0]);
if(ser.spPr && spPr.ln)
{ {
ptsY[j].brush = ser.brush; compiled_line.merge(spPr.ln);
ptsY[j].pen = ser.pen;
} }
if(Array.isArray(ser.dPt)) if(Array.isArray(ser.dPt))
{ {
for(j = 0; j < ser.dPt.length; ++j) for(var k = 0; k < ser.dPt.length; ++k)
{ {
if(ser.dPt[j].spPr && ser.dpt.spPr.Fill) if(ser.dPt[k].idx === pts[j].idx)
{ {
if(Array.isArray(ptsX)) if(ser.dPt[k].spPr)
{ {
ptsX[ser.dpt.idx].brush = ser.dpt.spPr.Fill; compiled_line.merge(ser.dPt[k].spPr.ln);
ptsX[ser.dpt.idx].brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA); }
break;
}
} }
ptsY[ser.dpt.idx].brush = ser.dpt.spPr.Fill;
ptsY[ser.dpt.idx].brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
} }
if(ser.dPt[j].spPr && ser.dpt.spPr.ln) pts[j].pen = compiled_line;
pts[j].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
}
else
{
for(i = 0; i < pts.length; ++i)
{ {
if(Array.isArray(ptsX)) var compiled_line = new CLn();
compiled_line.merge(default_line);
compiled_line.Fill.merge(base_line_fills[i]);
if(ser.spPr && spPr.ln)
{ {
ptsX[ser.dpt.idx].pen = ser.dpt.spPr.pen; compiled_line.merge(spPr.ln);
ptsX[ser.dpt.idx].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA); }
if(Array.isArray(ser.dPt))
{
for(var j = 0; j < ser.dPt.length; ++j)
{
if(ser.dPt[j].idx === pts[i].idx)
{
if(ser.dPt[j].spPr)
{
compiled_line.merge(ser.dPt[j].spPr.ln);
}
break;
} }
ptsY[ser.dpt.idx].pen = ser.dpt.spPr.pen;
ptsY[ser.dpt.idx].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
} }
} }
pts[i].pen = compiled_line;
pts[i].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
} }
} }
} }
}
}
else
{
var base_line_fills = getArrayFillsFromBase(style.line4, series.length);
for(var i = 0; i < series.length; ++i)
{
var default_line = parents.theme.themeElements.fmtScheme.lnStyleLst[0];
var ser = series[i];
var pts;
if(ser.val)
{
pts = ser.val.numRef.numCache.pts;
}
else if(ser.yVal)
{
pts = ser.yVal.numRef.numCache.pts;
}
else else
{ {
var pts = ser.val.numRef.numCache.pts; pts = [];
}
for(var j = 0; j < pts.length; ++j) for(var j = 0; j < pts.length; ++j)
{ {
pts[j].brush = arrayColors[j]; var compiled_line = new CLn();
pts[j].brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA); compiled_line.merge(default_line);
pts[j].pen = ser.pen; compiled_line.Fill.merge(base_line_fills[i]);
compiled_line.w *= style.line3;
if(ser.spPr && spPr.ln)
{
compiled_line.merge(spPr.ln);
} }
if(Array.isArray(ser.dPt)) if(Array.isArray(ser.dPt))
{ {
for(j = 0; j < ser.dPt.length; ++j) for(var k = 0; k < ser.dPt.length; ++k)
{ {
if(ser.dPt[j].spPr && ser.dpt.spPr.Fill) if(ser.dPt[k].idx === pts[j].idx)
{ {
pts[ser.dpt.idx].brush = ser.dpt.spPr.Fill; if(ser.dPt[k].spPr)
pts[ser.dpt.idx].brush.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
}
if(ser.dPt[j].spPr && ser.dpt.spPr.ln)
{ {
pts[ser.dpt.idx].pen = ser.dpt.spPr.pen; compiled_line.merge(ser.dPt[k].spPr.ln);
pts[ser.dpt.idx].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA); }
break;
}
}
} }
pts[j].brush = null;
pts[j].pen = compiled_line;
pts[j].pen.calculate(parents.theme, parents.slide, parents.layout, parents.master, RGBA);
} }
} }
} }
......
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