Commit 0e124c57 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

расчет hiLowLines для биржевых и линейных диаграмм

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@54186 954022d7-b5bf-4e40-9824-e11837661b57
parent 04b4749f
...@@ -2650,6 +2650,7 @@ function CreateStockChart(asc_series) ...@@ -2650,6 +2650,7 @@ function CreateStockChart(asc_series)
line_chart.setDLbls(new CDLbls()); line_chart.setDLbls(new CDLbls());
line_chart.addAxId(plot_area.catAx); line_chart.addAxId(plot_area.catAx);
line_chart.addAxId(plot_area.valAx); line_chart.addAxId(plot_area.valAx);
line_chart.setHiLowLines(new CSpPr());
for(var i = 0; i < asc_series.length; ++i) for(var i = 0; i < asc_series.length; ++i)
{ {
var series = new CLineSeries(); var series = new CLineSeries();
......
...@@ -45,7 +45,8 @@ CChartSpace.prototype.setRecalculateInfo = function() ...@@ -45,7 +45,8 @@ CChartSpace.prototype.setRecalculateInfo = function()
recalculateBrush: true, recalculateBrush: true,
recalculatePen: true, recalculatePen: true,
recalculatePlotAreaBrush: true, recalculatePlotAreaBrush: true,
recalculatePlotAreaPen: true recalculatePlotAreaPen: true,
recalculateHiLowLines: 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};
...@@ -260,6 +261,11 @@ CChartSpace.prototype.recalculate = function() ...@@ -260,6 +261,11 @@ CChartSpace.prototype.recalculate = function()
this.recalcInfo.recalculatePen = false; this.recalcInfo.recalculatePen = false;
} }
if(this.recalcInfo.recalculateHiLowLines)
{
this.recalculateHiLowLines();
this.recalcInfo.recalculateHiLowLines = false;
}
if(this.recalcInfo.recalculatePlotAreaBrush) if(this.recalcInfo.recalculatePlotAreaBrush)
{ {
this.recalculatePlotAreaChartBrush(); this.recalculatePlotAreaChartBrush();
...@@ -286,6 +292,7 @@ CChartSpace.prototype.recalculate = function() ...@@ -286,6 +292,7 @@ CChartSpace.prototype.recalculate = function()
this.recalcInfo.recalculateAxisVal = false; this.recalcInfo.recalculateAxisVal = false;
} }
for(var i = 0; i < this.recalcInfo.dataLbls.length; ++i) for(var i = 0; i < this.recalcInfo.dataLbls.length; ++i)
{ {
if(this.recalcInfo.dataLbls[i].series && this.recalcInfo.dataLbls[i].pt) if(this.recalcInfo.dataLbls[i].series && this.recalcInfo.dataLbls[i].pt)
...@@ -548,7 +555,8 @@ CChartSpace.prototype.recalculateMarkers = function() ...@@ -548,7 +555,8 @@ CChartSpace.prototype.recalculateMarkers = function()
{ {
if(this.chart && this.chart.plotArea && this.chart.plotArea.chart if(this.chart && this.chart.plotArea && this.chart.plotArea.chart
&& ((this.chart.plotArea.chart instanceof CLineChart && this.chart.plotArea.chart.marker) && ((this.chart.plotArea.chart instanceof CLineChart && this.chart.plotArea.chart.marker)
|| this.chart.plotArea.chart instanceof CScatterChart) || this.chart.plotArea.chart instanceof CScatterChart
|| this.chart.plotArea.chart instanceof CStockChart)
&& this.chart.plotArea.chart.series) && this.chart.plotArea.chart.series)
{ {
var chart_style = CHART_STYLE_MANAGER.getStyleByIndex(this.style); var chart_style = CHART_STYLE_MANAGER.getStyleByIndex(this.style);
...@@ -837,7 +845,7 @@ CChartSpace.prototype.recalculateSeriesColors = function() ...@@ -837,7 +845,7 @@ CChartSpace.prototype.recalculateSeriesColors = function()
} }
else else
{ {
if(!(this.chart.plotArea.chart instanceof CLineChart)) if(!(this.chart.plotArea.chart instanceof CLineChart || this.chart.plotArea.chart instanceof CScatterChart))
{ {
var base_fills = getArrayFillsFromBase(style.fill2, series.length); var base_fills = getArrayFillsFromBase(style.fill2, series.length);
var base_line_fills = null; var base_line_fills = null;
...@@ -1008,6 +1016,30 @@ CChartSpace.prototype.recalculateSeriesColors = function() ...@@ -1008,6 +1016,30 @@ CChartSpace.prototype.recalculateSeriesColors = function()
}, this, []); }, this, []);
}; };
CChartSpace.prototype.recalculateHiLowLines = function()
{
if(this.chart && this.chart.plotArea && (this.chart.plotArea.chart instanceof CStockChart || this.chart.plotArea.chart instanceof CLineChart) && this.chart.plotArea.chart.hiLowLines)
{
var parents = this.getParentObjects();
var default_line = parents.theme.themeElements.fmtScheme.lnStyleLst[0].createDuplicate();
if(this.style >=1 && this.style <= 32)
default_line.setFill(CreateUnifillSolidFillSchemeColor(15, 0));
else if(this.style >= 33 && this.style <= 34)
default_line.setFill(CreateUnifillSolidFillSchemeColor(8, 0));
else if(this.style >= 35 && this.style <= 40)
default_line.setFill(CreateUnifillSolidFillSchemeColor(8, -25000));
else
default_line.setFill(CreateUnifillSolidFillSchemeColor(12, 0));
default_line.merge(this.chart.plotArea.chart.hiLowLines.ln);
this.chart.plotArea.chart.calculatedHiLowLines = default_line;
default_line.calculate(parents.theme, parents.slide, parents.layout, parents.master, {R:0, G:0, B:0, A:255});
}
else
{
this.chart.plotArea.chart.calculatedHiLowLines = null;
}
};
function getPtsFromSeries(ser) function getPtsFromSeries(ser)
{ {
if(ser) if(ser)
......
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