Commit 39849c71 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

расчет pen для сетки диаграммы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53717 954022d7-b5bf-4e40-9824-e11837661b57
parent a1f0b418
...@@ -94,6 +94,25 @@ function CChartStyleManager() ...@@ -94,6 +94,25 @@ function CChartStyleManager()
{ {
this.styles[i] = new CChartStyle(EFFECT_INTENSE, EFFECT_INTENSE, [f(i-43, 0)], EFFECT_SUBTLE, EFFECT_NONE, [], 5, [f(i-43, 0)], 9); this.styles[i] = new CChartStyle(EFFECT_INTENSE, EFFECT_INTENSE, [f(i-43, 0)], EFFECT_SUBTLE, EFFECT_NONE, [], 5, [f(i-43, 0)], 9);
} }
this.defaultLineStyles = [];
this.defaultLineStyles[0] = new ChartLineStyle(f(15, 0), f(15, 0.5), f(15, 0.75), f(15, 0), EFFECT_SUBTLE);
for(i = 0; i < 32; ++i)
{
this.defaultLineStyles[i] = this.defaultLineStyles[0];
}
this.defaultLineStyles[32] = new ChartLineStyle(f(8, 0), f(15, 0.5), f(8, 0.75), f(8, 0), EFFECT_SUBTLE);
this.defaultLineStyles[33] = this.defaultLineStyles[32];
this.defaultLineStyles[34] = new ChartLineStyle(f(8, 0), f(15, 0.5), f(8, 0.75), f(8, -0.25), EFFECT_SUBTLE);
for(i = 35; i < 40; ++i)
{
this.defaultLineStyles[i] = this.defaultLineStyles[34];
}
this.defaultLineStyles[40] = new ChartLineStyle(f(8, 0), f(15, 0.9), f(12, 0), f(12, 0), EFFECT_NONE);
for(var i = 41; i < 48; ++i)
{
this.defaultLineStyles[i] = this.defaultLineStyles[40];
}
}, },
this, []); this, []);
} }
...@@ -107,9 +126,27 @@ CChartStyleManager.prototype = ...@@ -107,9 +126,27 @@ CChartStyleManager.prototype =
return this.styles[(index - 1) % 48]; return this.styles[(index - 1) % 48];
} }
return this.styles[1]; return this.styles[1];
},
getDefaultLineStyleByIndex: function(index)
{
if(isRealNumber(index))
{
return this.defaultLineStyles[(index - 1) % 48];
}
return this.defaultLineStyles[2];
} }
}; };
function ChartLineStyle(axisAndMajorGridLines, minorGridlines, chartArea, otherLines, floorChartArea)
{
this.axisAndMajorGridLines = axisAndMajorGridLines;
this.minorGridlines = minorGridlines;
this.chartArea = chartArea;
this.otherLines = otherLines;
this.floorChartArea = floorChartArea;
}
function CChartStyle(effect, fill1, fill2, fill3, line1, line2, line3, line4, markerSize) function CChartStyle(effect, fill1, fill2, fill3, line1, line2, line3, line4, markerSize)
{ {
this.effect = effect; this.effect = effect;
......
...@@ -31,7 +31,8 @@ CChartSpace.prototype.setRecalculateInfo = function() ...@@ -31,7 +31,8 @@ CChartSpace.prototype.setRecalculateInfo = function()
recalculateChart: true, recalculateChart: true,
recalculateBaseColors: true, recalculateBaseColors: true,
recalculateSeriesColors: true, recalculateSeriesColors: true,
recalculateMarkers: true recalculateMarkers: true,
recalculateGridLines: true
}; };
this.baseColors = []; this.baseColors = [];
this.bounds = {l: 0, t: 0, r: 0, b:0, w: 0, h:0}; this.bounds = {l: 0, t: 0, r: 0, b:0, w: 0, h:0};
...@@ -139,37 +140,47 @@ CChartSpace.prototype.recalculateBounds = function() ...@@ -139,37 +140,47 @@ CChartSpace.prototype.recalculateBounds = function()
CChartSpace.prototype.recalculate = function() CChartSpace.prototype.recalculate = function()
{ {
if(this.recalcInfo.recalculateTransform)
{ ExecuteNoHistory(function()
this.recalculateTransform();
this.recalcInforecalculateTransform = false;
}
if(this.recalcInfo.recalculateBounds)
{
this.recalculateBounds();
this.recalcInfo.recalculateBounds = false;
}
if(this.recalcInfo.recalculateBaseColors)
{
this.recalculateBaseColors();
this.recalcInfo.recalculateBaseColors = false;
}
if(this.recalcInfo.recalculateMarkers)
{
this.recalculateMarkers();
this.recalcInfo.recalculateMarkers = false;
}
if(this.recalcInfo.recalculateSeriesColors)
{ {
this.recalculateSeriesColors(); if(this.recalcInfo.recalculateTransform)
this.recalcInfo.recalculateSeriesColors = false; {
} this.recalculateTransform();
this.recalcInforecalculateTransform = false;
if(this.recalcInfo.recalculateChart) }
{ if(this.recalcInfo.recalculateBounds)
this.recalculateChart(); {
this.recalcInfo.recalculateChart = false; this.recalculateBounds();
} this.recalcInfo.recalculateBounds = false;
}
if(this.recalcInfo.recalculateBaseColors)
{
this.recalculateBaseColors();
this.recalcInfo.recalculateBaseColors = false;
}
if(this.recalcInfo.recalculateMarkers)
{
this.recalculateMarkers();
this.recalcInfo.recalculateMarkers = false;
}
if(this.recalcInfo.recalculateSeriesColors)
{
this.recalculateSeriesColors();
this.recalcInfo.recalculateSeriesColors = false;
}
if(this.recalcInfo.recalculateGridLines)
{
this.recalculateGridLines();
this.recalcInfo.recalculateGridLines = false;
}
if(this.recalcInfo.recalculateChart)
{
this.recalculateChart();
this.recalcInfo.recalculateChart = false;
}
}, this, []);
}; };
CChartSpace.prototype.deselect = CShape.prototype.deselect; CChartSpace.prototype.deselect = CShape.prototype.deselect;
CChartSpace.prototype.hitInWorkArea = function() CChartSpace.prototype.hitInWorkArea = function()
...@@ -336,6 +347,48 @@ function getArrayFillsFromBase(arrBaseFills, needFillsCount) ...@@ -336,6 +347,48 @@ function getArrayFillsFromBase(arrBaseFills, needFillsCount)
return ret; return ret;
} }
CChartSpace.prototype.recalculateGridLines = function()
{
if(this.chart && this.chart.plotArea)
{
function calcMajorMinorGridLines(axis, defaultStyle, subtleLine, parents)
{
function calcGridLine(defaultStyle, spPr, subtleLine, parents)
{
if(spPr)
{
var compiled_grid_lines = new CLn();
compiled_grid_lines.merge(subtleLine);
if(!compiled_grid_lines.Fill)
{
compiled_grid_lines.setFill(new CUniFill());
}
compiled_grid_lines.Fill.merge(defaultStyle);
compiled_grid_lines.merge(spPr.ln);
compiled_grid_lines.calculate(parents.theme, parents.slide, parents.layout, parents.master, {R: 0, G: 0, B: 0, A: 255})
return compiled_grid_lines;
}
return null;
}
axis.compiledMajorGridLines = calcGridLine(defaultStyle.axisAndMajorGridLines, axis.majorGridlines, subtleLine, parents);
axis.compiledMinorGridLines = calcGridLine(defaultStyle.minorGridlines, axis.minorGridlines, subtleLine, parents);
}
var default_style = CHART_STYLE_MANAGER.getDefaultLineStyleByIndex(this.style);
var parent_objects = this.getParentObjects();
var RGBA = {R:0, G:0, B:0, A: 255};
var subtle_line;
if(parent_objects.theme && parent_objects.theme.themeElements
&& parent_objects.theme.themeElements.fmtScheme
&& parent_objects.theme.themeElements.fmtScheme.lnStyleLst)
{
subtle_line = parent_objects.theme.themeElements.fmtScheme.lnStyleLst[0];
}
calcMajorMinorGridLines(this.chart.plotArea.valAx, default_style, subtle_line, parent_objects);
calcMajorMinorGridLines(this.chart.plotArea.catAx, default_style, subtle_line, parent_objects);
}
}
CChartSpace.prototype.recalculateMarkers = function() CChartSpace.prototype.recalculateMarkers = function()
{ {
ExecuteNoHistory(function() ExecuteNoHistory(function()
......
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