Commit 85d3b0f4 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@54103 954022d7-b5bf-4e40-9824-e11837661b57
parent 56e61446
This diff is collapsed.
...@@ -1943,6 +1943,7 @@ function CreateLineChart(asc_series, type) ...@@ -1943,6 +1943,7 @@ function CreateLineChart(asc_series, type)
chart.setPlotArea(new CPlotArea()); chart.setPlotArea(new CPlotArea());
chart.setLegend(new CLegend()); chart.setLegend(new CLegend());
chart.setPlotVisOnly(true); chart.setPlotVisOnly(true);
chart.setTitle(new CTitle());
var disp_blanks_as; var disp_blanks_as;
if(type === GROUPING_STANDARD) if(type === GROUPING_STANDARD)
{ {
...@@ -1958,7 +1959,13 @@ function CreateLineChart(asc_series, type) ...@@ -1958,7 +1959,13 @@ function CreateLineChart(asc_series, type)
plot_area.setLayout(new CLayout()); plot_area.setLayout(new CLayout());
plot_area.setChart(new CLineChart()); plot_area.setChart(new CLineChart());
plot_area.setCatAx(new CAxis()); plot_area.setCatAx(new CAxis());
plot_area.catAx.setTitle(new CTitle());
plot_area.setValAx(new CAxis()); plot_area.setValAx(new CAxis());
plot_area.valAx.setTitle(new CTitle());
var title = plot_area.valAx.title;
title.setTxPr(new CTextBody());
title.txPr.setBodyPr(new CBodyPr());
title.txPr.bodyPr.setVert(nVertTTvert);
var line_chart = plot_area.chart; var line_chart = plot_area.chart;
line_chart.setGrouping(type); line_chart.setGrouping(type);
line_chart.setVaryColors(false); line_chart.setVaryColors(false);
......
...@@ -36,7 +36,9 @@ CChartSpace.prototype.setRecalculateInfo = function() ...@@ -36,7 +36,9 @@ CChartSpace.prototype.setRecalculateInfo = function()
recalculateMarkers: true, recalculateMarkers: true,
recalculateGridLines: true, recalculateGridLines: true,
recalculateDLbls: true, recalculateDLbls: true,
dataLbls:[] recalculateAxisLabels: true,
dataLbls:[],
axisLabels: []
}; };
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};
...@@ -69,7 +71,10 @@ CChartSpace.prototype.recalcDLbls = function() ...@@ -69,7 +71,10 @@ CChartSpace.prototype.recalcDLbls = function()
CChartSpace.prototype.addToSetPosition = function(dLbl) CChartSpace.prototype.addToSetPosition = function(dLbl)
{ {
this.recalcInfo.dataLbls.push(dLbl); if(dLbl instanceof CDLbl)
this.recalcInfo.dataLbls.push(dLbl);
else if(dLbl instanceof CTitle)
this.recalcInfo.axisLabels.push(dLbl);
}; };
CChartSpace.prototype.addToRecalculate = CShape.prototype.addToRecalculate; CChartSpace.prototype.addToRecalculate = CShape.prototype.addToRecalculate;
...@@ -115,7 +120,7 @@ CChartSpace.prototype.canMove = CShape.prototype.canMove; ...@@ -115,7 +120,7 @@ CChartSpace.prototype.canMove = CShape.prototype.canMove;
CChartSpace.prototype.canRotate = function() CChartSpace.prototype.canRotate = function()
{ {
return false; return false;
} };
...@@ -133,23 +138,40 @@ CChartSpace.prototype.draw = function(graphics) ...@@ -133,23 +138,40 @@ CChartSpace.prototype.draw = function(graphics)
this.chartObj.draw(this, graphics); this.chartObj.draw(this, graphics);
graphics.reset(); graphics.reset();
graphics.SetIntegerGrid(intGrid); graphics.SetIntegerGrid(intGrid);
if(this.chart && this.chart.plotArea && this.chart.plotArea.chart && this.chart.plotArea.chart.series) if(this.chart)
{ {
var series = this.chart.plotArea.chart.series; if(this.chart.plotArea)
for(var i = 0; i < series.length; ++i) {
{ if(this.chart.plotArea.chart && this.chart.plotArea.chart.series)
var ser = series[i]; {
var pts = getPtsFromSeries(ser); var series = this.chart.plotArea.chart.series;
for(var j = 0; j < pts.length; ++j) for(var i = 0; i < series.length; ++i)
{ {
if(pts[j].compiledDlb) var ser = series[i];
pts[j].compiledDlb.draw(graphics); var pts = getPtsFromSeries(ser);
} for(var j = 0; j < pts.length; ++j)
} {
} if(pts[j].compiledDlb)
pts[j].compiledDlb.draw(graphics);
}
}
}
if(this.chart.plotArea.catAx && this.chart.plotArea.catAx.title)
{
this.chart.plotArea.catAx.title.draw(graphics);
}
if(this.chart.plotArea.valAx && this.chart.plotArea.valAx.title)
{
this.chart.plotArea.valAx.title.draw(graphics);
}
}
if(this.chart.title)
{
this.chart.title.draw(graphics);
}
}
}; };
CChartSpace.prototype.recalculateBounds = function() CChartSpace.prototype.recalculateBounds = function()
{ {
...@@ -213,6 +235,11 @@ CChartSpace.prototype.recalculate = function() ...@@ -213,6 +235,11 @@ CChartSpace.prototype.recalculate = function()
this.recalculateDLbls(); this.recalculateDLbls();
this.recalcInfo.recalculateDLbls = false; this.recalcInfo.recalculateDLbls = false;
} }
if(this.recalcInfo.recalculateAxisLabels)
{
this.recalculateAxisLabels();
this.recalcInfo.recalculateAxisLabels = false;
}
if(this.recalcInfo.recalculateChart) if(this.recalcInfo.recalculateChart)
{ {
this.recalculateChart(); this.recalculateChart();
...@@ -226,6 +253,34 @@ CChartSpace.prototype.recalculate = function() ...@@ -226,6 +253,34 @@ CChartSpace.prototype.recalculate = function()
this.recalcInfo.dataLbls.length = 0; this.recalcInfo.dataLbls.length = 0;
}, this, []); }, this, []);
}; };
CChartSpace.prototype.recalculateAxisLabels = function()
{
if(this.chart && this.chart.title)
{
var title = this.chart.title;
title.parent = this.chart;
title.chart = this;
title.recalculate();
}
if(this.chart && this.chart.plotArea)
{
if(this.chart.plotArea.catAx && this.chart.plotArea.catAx.title)
{
var title = this.chart.plotArea.catAx.title;
title.parent = this.chart.plotArea.catAx;
title.chart = this;
title.recalculate();
}
if(this.chart.plotArea.valAx && this.chart.plotArea.valAx.title)
{
var title = this.chart.plotArea.valAx.title;
title.parent = this.chart.plotArea.valAx;
title.chart = this;
title.recalculate();
}
}
};
CChartSpace.prototype.deselect = CShape.prototype.deselect; CChartSpace.prototype.deselect = CShape.prototype.deselect;
CChartSpace.prototype.hitInWorkArea = function() CChartSpace.prototype.hitInWorkArea = function()
{ {
...@@ -411,7 +466,7 @@ CChartSpace.prototype.recalculateGridLines = function() ...@@ -411,7 +466,7 @@ CChartSpace.prototype.recalculateGridLines = function()
} }
axis.compiledMajorGridLines = calcGridLine(defaultStyle.axisAndMajorGridLines, axis.majorGridlines, subtleLine, parents); axis.compiledMajorGridLines = calcGridLine(defaultStyle.axisAndMajorGridLines, axis.majorGridlines, subtleLine, parents);
axis.compiledMinorGridLines = calcGridLine(defaultStyle.minorGridlines, axis.minorGridlines, subtleLine, parents); axis.compiledMinorGridLines = calcGridLine(defaultStyle.minorGridlines, axis.minorGridlines, subtleLine, parents);
} };
var default_style = CHART_STYLE_MANAGER.getDefaultLineStyleByIndex(this.style); var default_style = CHART_STYLE_MANAGER.getDefaultLineStyleByIndex(this.style);
var parent_objects = this.getParentObjects(); var parent_objects = this.getParentObjects();
var RGBA = {R:0, G:0, B:0, A: 255}; var RGBA = {R:0, G:0, B:0, A: 255};
...@@ -425,7 +480,7 @@ CChartSpace.prototype.recalculateGridLines = function() ...@@ -425,7 +480,7 @@ CChartSpace.prototype.recalculateGridLines = function()
calcMajorMinorGridLines(this.chart.plotArea.valAx, default_style, subtle_line, parent_objects); calcMajorMinorGridLines(this.chart.plotArea.valAx, default_style, subtle_line, parent_objects);
calcMajorMinorGridLines(this.chart.plotArea.catAx, 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()
{ {
...@@ -944,6 +999,6 @@ CChartSpace.prototype.recalculateDLbls = function() ...@@ -944,6 +999,6 @@ CChartSpace.prototype.recalculateDLbls = 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