Commit 8896327f authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Bug 25709 - Не изменяются настройки линий сетки после смены типа диаграммы.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57517 954022d7-b5bf-4e40-9824-e11837661b57
parent 0d957d6b
......@@ -1911,104 +1911,7 @@ DrawingObjectsController.prototype =
var plot_area = chart.plotArea;
//horAxisLabel
var hor_axis = plot_area.getHorizontalAxis();
var hor_axis_label_setting = chartSettings.getHorAxisLabel();
if(hor_axis)
{
if(hor_axis_label_setting !== null)
{
switch (hor_axis_label_setting)
{
case c_oAscChartHorAxisLabelShowSettings.none:
{
if(hor_axis.title)
hor_axis.setTitle(null);
break;
}
case c_oAscChartHorAxisLabelShowSettings.noOverlay:
{
if(!hor_axis.title)
{
hor_axis.setTitle(new CTitle());
}
if(!hor_axis.title.txPr)
{
hor_axis.title.setTxPr(new CTextBody());
}
if(!hor_axis.title.txPr.bodyPr)
{
hor_axis.title.txPr.setBodyPr(new CBodyPr());
hor_axis.title.txPr.bodyPr.reset();
}
if(!hor_axis.title.txPr.content)
{
hor_axis.title.txPr.setContent(new CDocumentContent(hor_axis.title.txPr, chart_space.getDrawingDocument(), 0, 0, 100, 500, false, false, true));
}
if(hor_axis.title.overlay !== false)
hor_axis.title.setOverlay(false);
break;
}
}
}
hor_axis.setMenuProps(chartSettings.getHorAxisProps());
}
//vertAxis
var vert_axis = plot_area.getVerticalAxis(); //TODO: запрашивать у chart_type
var vert_axis_labels_settings = chartSettings.getVertAxisLabel();
if(vert_axis)
{
if(vert_axis_labels_settings !== null)
{
switch (vert_axis_labels_settings)
{
case c_oAscChartVertAxisLabelShowSettings.none:
{
if(vert_axis.title)
{
vert_axis.setTitle(null);
}
break;
}
case c_oAscChartVertAxisLabelShowSettings.vertical:
{
//TODO: пока СDocumentContent не поддерживает вертикальный текст, может быть будет когда-нибудь, хотя вряд ли.
break;
}
default:
{
if( vert_axis_labels_settings === c_oAscChartVertAxisLabelShowSettings.rotated
|| vert_axis_labels_settings === c_oAscChartVertAxisLabelShowSettings.horizontal)
{
if(!vert_axis.title)
{
vert_axis.setTitle(new CTitle());
}
if(!vert_axis.title.txPr)
{
vert_axis.title.setTxPr(new CTextBody());
}
if(!vert_axis.title.txPr.bodyPr)
{
vert_axis.title.txPr.setBodyPr(new CBodyPr());
vert_axis.title.txPr.bodyPr.reset();
}
if(!vert_axis.title.txPr.content)
{
vert_axis.title.txPr.setContent(new CDocumentContent(vert_axis.title.txPr, chart_space.getDrawingDocument(), 0, 0, 100, 500, false, false, true));
}
if(vert_axis_labels_settings === c_oAscChartVertAxisLabelShowSettings.rotated && vert_axis.title.txPr.bodyPr.vert !== nVertTTvert)
vert_axis.title.txPr.bodyPr.setVert(nVertTTvert);
if(vert_axis.title.overlay !== false)
{
vert_axis.title.setOverlay(false);
}
}
}
}
}
vert_axis.setMenuProps(chartSettings.getVertAxisProps())
}
//legend
var legend_pos_settings = chartSettings.getLegendPos();
if(legend_pos_settings !== null)
......@@ -2039,52 +1942,6 @@ DrawingObjectsController.prototype =
}
}
//gridLines
//Hor GridLInes
var setAxisGridLines = function(axis, gridLinesSettings)
{
if(axis)
{
switch(gridLinesSettings)
{
case c_oAscGridLinesSettings.none:
{
if(axis.majorGridlines)
axis.setMajorGridlines(null);
if(axis.minorGridlines)
axis.setMinorGridlines(null);
break;
}
case c_oAscGridLinesSettings.major:
{
if(!axis.majorGridlines)
axis.setMajorGridlines(new CSpPr());
if(axis.minorGridlines)
axis.setMinorGridlines(null);
break;
}
case c_oAscGridLinesSettings.minor:
{
if(!axis.minorGridlines)
axis.setMinorGridlines(new CSpPr());
if(axis.majorGridlines)
axis.setMajorGridlines(null);
break;
}
case c_oAscGridLinesSettings.majorMinor:
{
if(!axis.minorGridlines)
axis.setMinorGridlines(new CSpPr());
if(!axis.majorGridlines)
axis.setMajorGridlines(new CSpPr());
break;
}
}
}
};
setAxisGridLines(plot_area.getVerticalAxis(), chartSettings.getHorGridLines());
setAxisGridLines(plot_area.getHorizontalAxis(), chartSettings.getVertGridLines());
var chart_type = plot_area.charts[0];
//Data Labels
......@@ -2400,6 +2257,152 @@ DrawingObjectsController.prototype =
}
}
var hor_axis = plot_area.getHorizontalAxis();
var hor_axis_label_setting = chartSettings.getHorAxisLabel();
if(hor_axis)
{
if(hor_axis_label_setting !== null)
{
switch (hor_axis_label_setting)
{
case c_oAscChartHorAxisLabelShowSettings.none:
{
if(hor_axis.title)
hor_axis.setTitle(null);
break;
}
case c_oAscChartHorAxisLabelShowSettings.noOverlay:
{
if(!hor_axis.title)
{
hor_axis.setTitle(new CTitle());
}
if(!hor_axis.title.txPr)
{
hor_axis.title.setTxPr(new CTextBody());
}
if(!hor_axis.title.txPr.bodyPr)
{
hor_axis.title.txPr.setBodyPr(new CBodyPr());
hor_axis.title.txPr.bodyPr.reset();
}
if(!hor_axis.title.txPr.content)
{
hor_axis.title.txPr.setContent(new CDocumentContent(hor_axis.title.txPr, chart_space.getDrawingDocument(), 0, 0, 100, 500, false, false, true));
}
if(hor_axis.title.overlay !== false)
hor_axis.title.setOverlay(false);
break;
}
}
}
hor_axis.setMenuProps(chartSettings.getHorAxisProps());
}
//vertAxis
var vert_axis = plot_area.getVerticalAxis(); //TODO: запрашивать у chart_type
var vert_axis_labels_settings = chartSettings.getVertAxisLabel();
if(vert_axis)
{
if(vert_axis_labels_settings !== null)
{
switch (vert_axis_labels_settings)
{
case c_oAscChartVertAxisLabelShowSettings.none:
{
if(vert_axis.title)
{
vert_axis.setTitle(null);
}
break;
}
case c_oAscChartVertAxisLabelShowSettings.vertical:
{
//TODO: пока СDocumentContent не поддерживает вертикальный текст, может быть будет когда-нибудь, хотя вряд ли.
break;
}
default:
{
if( vert_axis_labels_settings === c_oAscChartVertAxisLabelShowSettings.rotated
|| vert_axis_labels_settings === c_oAscChartVertAxisLabelShowSettings.horizontal)
{
if(!vert_axis.title)
{
vert_axis.setTitle(new CTitle());
}
if(!vert_axis.title.txPr)
{
vert_axis.title.setTxPr(new CTextBody());
}
if(!vert_axis.title.txPr.bodyPr)
{
vert_axis.title.txPr.setBodyPr(new CBodyPr());
vert_axis.title.txPr.bodyPr.reset();
}
if(!vert_axis.title.txPr.content)
{
vert_axis.title.txPr.setContent(new CDocumentContent(vert_axis.title.txPr, chart_space.getDrawingDocument(), 0, 0, 100, 500, false, false, true));
}
if(vert_axis_labels_settings === c_oAscChartVertAxisLabelShowSettings.rotated && vert_axis.title.txPr.bodyPr.vert !== nVertTTvert)
vert_axis.title.txPr.bodyPr.setVert(nVertTTvert);
if(vert_axis.title.overlay !== false)
{
vert_axis.title.setOverlay(false);
}
}
}
}
}
vert_axis.setMenuProps(chartSettings.getVertAxisProps())
}
//gridLines
//Hor GridLInes
var setAxisGridLines = function(axis, gridLinesSettings)
{
if(axis)
{
switch(gridLinesSettings)
{
case c_oAscGridLinesSettings.none:
{
if(axis.majorGridlines)
axis.setMajorGridlines(null);
if(axis.minorGridlines)
axis.setMinorGridlines(null);
break;
}
case c_oAscGridLinesSettings.major:
{
if(!axis.majorGridlines)
axis.setMajorGridlines(new CSpPr());
if(axis.minorGridlines)
axis.setMinorGridlines(null);
break;
}
case c_oAscGridLinesSettings.minor:
{
if(!axis.minorGridlines)
axis.setMinorGridlines(new CSpPr());
if(axis.majorGridlines)
axis.setMajorGridlines(null);
break;
}
case c_oAscGridLinesSettings.majorMinor:
{
if(!axis.minorGridlines)
axis.setMinorGridlines(new CSpPr());
if(!axis.majorGridlines)
axis.setMajorGridlines(new CSpPr());
break;
}
}
}
};
setAxisGridLines(plot_area.getVerticalAxis(), chartSettings.getHorGridLines());
setAxisGridLines(plot_area.getHorizontalAxis(), chartSettings.getVertGridLines());
chart_type = plot_area.charts[0];
//подписи данных
if(typeof chart_type.setDLbls === "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