Commit b110aa62 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@56642 954022d7-b5bf-4e40-9824-e11837661b57
parent 391893e6
...@@ -1624,7 +1624,6 @@ DrawingObjectsController.prototype = ...@@ -1624,7 +1624,6 @@ DrawingObjectsController.prototype =
} }
if(isRealNumber(props.Width) && isRealNumber(props.Height)) if(isRealNumber(props.Width) && isRealNumber(props.Height))
{ {
//Todo: может отсутствовать spPr и xfrm
for(i = 0; i < objects_by_type.shapes.length; ++i) for(i = 0; i < objects_by_type.shapes.length; ++i)
{ {
CheckSpPrXfrm(objects_by_type.shapes[i]); CheckSpPrXfrm(objects_by_type.shapes[i]);
...@@ -1677,8 +1676,6 @@ DrawingObjectsController.prototype = ...@@ -1677,8 +1676,6 @@ DrawingObjectsController.prototype =
{ {
var chart_space = objects_by_types.charts[0]; var chart_space = objects_by_types.charts[0];
this.applyPropsToChartSpace(chartSettings, chart_space); this.applyPropsToChartSpace(chartSettings, chart_space);
chart_space.addToRecalculate(); //TODO
chart_space.setRecalculateInfo();//TODO: обязательно переделать
} }
}, },
...@@ -1775,7 +1772,8 @@ DrawingObjectsController.prototype = ...@@ -1775,7 +1772,8 @@ DrawingObjectsController.prototype =
{ {
case c_oAscChartHorAxisLabelShowSettings.none: case c_oAscChartHorAxisLabelShowSettings.none:
{ {
hor_axis.setTitle(null); if(hor_axis.title)
hor_axis.setTitle(null);
break; break;
} }
case c_oAscChartHorAxisLabelShowSettings.noOverlay: case c_oAscChartHorAxisLabelShowSettings.noOverlay:
...@@ -1791,12 +1789,12 @@ DrawingObjectsController.prototype = ...@@ -1791,12 +1789,12 @@ DrawingObjectsController.prototype =
if(!hor_axis.title.txPr.bodyPr) if(!hor_axis.title.txPr.bodyPr)
{ {
hor_axis.title.txPr.setBodyPr(new CBodyPr()); hor_axis.title.txPr.setBodyPr(new CBodyPr());
hor_axis.title.txPr.bodyPr.reset();
} }
if(!hor_axis.title.txPr.content) 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)); hor_axis.title.txPr.setContent(new CDocumentContent(hor_axis.title.txPr, chart_space.getDrawingDocument(), 0, 0, 100, 500, false, false, true));
} }
hor_axis.title.txPr.bodyPr.reset();
if(hor_axis.title.overlay) if(hor_axis.title.overlay)
hor_axis.title.setOverlay(false); hor_axis.title.setOverlay(false);
break; break;
...@@ -1846,13 +1844,13 @@ DrawingObjectsController.prototype = ...@@ -1846,13 +1844,13 @@ DrawingObjectsController.prototype =
if(!vert_axis.title.txPr.bodyPr) if(!vert_axis.title.txPr.bodyPr)
{ {
vert_axis.title.txPr.setBodyPr(new CBodyPr()); vert_axis.title.txPr.setBodyPr(new CBodyPr());
vert_axis.title.txPr.bodyPr.reset();
} }
if( !vert_axis.title.txPr.content) 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)); vert_axis.title.txPr.setContent(new CDocumentContent(vert_axis.title.txPr, chart_space.getDrawingDocument(), 0, 0, 100, 500, false, false, true));
} }
vert_axis.title.txPr.bodyPr.reset(); if(vert_axis_labels_settings === c_oAscChartVertAxisLabelShowSettings.rotated && vert_axis.title.txPr.bodyPr.vert !== nVertTTvert)
if(vert_axis_labels_settings === c_oAscChartVertAxisLabelShowSettings.rotated)
vert_axis.title.txPr.bodyPr.setVert(nVertTTvert); vert_axis.title.txPr.bodyPr.setVert(nVertTTvert);
} }
} }
...@@ -1879,7 +1877,8 @@ DrawingObjectsController.prototype = ...@@ -1879,7 +1877,8 @@ DrawingObjectsController.prototype =
} }
if(isRealNumber(LEGEND_POS_MAP[legend_pos_settings])) if(isRealNumber(LEGEND_POS_MAP[legend_pos_settings]))
{ {
chart.legend.setLegendPos(LEGEND_POS_MAP[legend_pos_settings]); if(chart.legendPos !== LEGEND_POS_MAP[legend_pos_settings])
chart.legend.setLegendPos(LEGEND_POS_MAP[legend_pos_settings]);
var b_overlay = c_oAscChartLegendShowSettings.leftOverlay === legend_pos_settings || legend_pos_settings === c_oAscChartLegendShowSettings.rightOverlay; var b_overlay = c_oAscChartLegendShowSettings.leftOverlay === legend_pos_settings || legend_pos_settings === c_oAscChartLegendShowSettings.rightOverlay;
if(chart.legend.overlay !== b_overlay) if(chart.legend.overlay !== b_overlay)
{ {
...@@ -1943,7 +1942,8 @@ DrawingObjectsController.prototype = ...@@ -1943,7 +1942,8 @@ DrawingObjectsController.prototype =
{ {
if(data_labels_pos_setting === c_oAscChartDataLabelsPos.none) if(data_labels_pos_setting === c_oAscChartDataLabelsPos.none)
{ {
chart_type.setDLbls(null); if(chart_type.dLbls)
chart_type.setDLbls(null);
} }
else else
{ {
...@@ -1955,15 +1955,11 @@ DrawingObjectsController.prototype = ...@@ -1955,15 +1955,11 @@ DrawingObjectsController.prototype =
d_lbls.setShowVal(true); d_lbls.setShowVal(true);
chart_type.setDLbls(d_lbls); chart_type.setDLbls(d_lbls);
} }
chart_type.dLbls.setDLblPos(DLBL_POS_DEFINES_MAP[data_labels_pos_setting]); if(chart_type.dLbls.dLblPos !== DLBL_POS_DEFINES_MAP[data_labels_pos_setting])
chart_type.dLbls.setDLblPos(DLBL_POS_DEFINES_MAP[data_labels_pos_setting]);
} }
} }
} }
//Vert Axis
//TODO
//Hor Axis
//TODO
var i; var i;
var type = chartSettings.getType(); var type = chartSettings.getType();
var need_groupping, need_num_fmt, need_bar_dir; var need_groupping, need_num_fmt, need_bar_dir;
...@@ -2205,10 +2201,7 @@ DrawingObjectsController.prototype = ...@@ -2205,10 +2201,7 @@ DrawingObjectsController.prototype =
case c_oAscChartTypeSettings.scatterLine: case c_oAscChartTypeSettings.scatterLine:
case c_oAscChartTypeSettings.scatterSmooth: case c_oAscChartTypeSettings.scatterSmooth:
{ {
if(chart_type.getObjectType() === historyitem_type_ScatterChart) if(chart_type.getObjectType() !== historyitem_type_ScatterChart)
{
}
else
{ {
new_chart_type = new CScatterChart(); new_chart_type = new CScatterChart();
plot_area.addChart(new_chart_type, 0); plot_area.addChart(new_chart_type, 0);
......
This diff is collapsed.
...@@ -736,13 +736,13 @@ CChartSpace.prototype = ...@@ -736,13 +736,13 @@ CChartSpace.prototype =
clearFormatting: function() clearFormatting: function()
{ {
if(this.spPr)
{
this.spPr.Fill && this.spPr.setFill(null);
this.spPr.ln && this.spPr.setLn(null);
}
if(this.chart) if(this.chart)
{ {
if(this.chart.spPr)
{
this.chart.spPr.Fill && this.chart.spPr.setFill(null);
this.chart.spPr.ln && this.chart.spPr.setLn(null);
}
if(this.chart.plotArea) if(this.chart.plotArea)
{ {
if(this.chart.plotArea.spPr) if(this.chart.plotArea.spPr)
...@@ -971,7 +971,6 @@ CChartSpace.prototype = ...@@ -971,7 +971,6 @@ CChartSpace.prototype =
chart_type.addSer(series); chart_type.addSer(series);
} }
} }
this.setRecalculateInfo();
} }
}, },
...@@ -986,8 +985,78 @@ CChartSpace.prototype = ...@@ -986,8 +985,78 @@ CChartSpace.prototype =
this.Id = r.GetString2(); this.Id = r.GetString2();
}, },
Refresh_RecalcData: function()
{}, handleUpdateType: function()
{
this.recalcInfo.recalculateChart = true;
this.recalcInfo.recalculateSeriesColors = true;
this.recalcInfo.recalculateMarkers = true;
this.recalcInfo.recalculateGridLines = true;
this.recalcInfo.recalculateDLbls = true;
this.recalcInfo.recalculateAxisLabels = true;
this.recalcInfo.dataLbls.length = 0;
this.recalcInfo.axisLabels.length = 0;
this.recalcInfo.recalculateAxisVal = true;
this.recalcInfo.recalculateAxisTickMark = true;
this.recalcInfo.recalculateHiLowLines = true;
this.recalcInfo.recalculateUpDownBars = true;
this.recalcInfo.recalculateLegend = true;
this.recalcInfo.recalculateReferences = true;
this.recalcInfo.recalculateBBox = true;
this.recalcInfo.recalculateFormulas = true;
this.chartObj = null;
this.addToRecalculate();
},
handleUpdateInternalChart: function()
{
this.recalcInfo.recalculateChart = true;
this.recalcInfo.recalculateSeriesColors = true;
this.recalcInfo.recalculateDLbls = true;
this.recalcInfo.recalculateAxisLabels = true;
this.recalcInfo.dataLbls.length = 0;
this.recalcInfo.axisLabels.length = 0;
this.recalcInfo.recalculateAxisVal = true;
this.recalcInfo.recalculateLegend = true;
this.chartObj = null;
this.addToRecalculate();
},
handleUpdateGridlines: function()
{
this.recalcInfo.recalculateGridLines = true;
this.addToRecalculate();
},
handleUpdateDataLabels: function()
{
this.recalcInfo.recalculateDLbls = true;
this.addToRecalculate();
},
Refresh_RecalcData: function(data)
{
switch(data.Type)
{
case historyitem_ChartSpace_SetStyle:
{
this.handleUpdateStyle();
break;
}
case historyitem_ChartSpace_SetTxPr:
{
this.recalcInfo.recalculateChart = true;
this.recalcInfo.recalculateLegend = true;
this.recalcInfo.recalculateDLbls = true;
this.recalcInfo.recalculateAxisVal = true;
this.recalcInfo.recalculateAxisCat = true;
this.recalcInfo.recalculateAxisLabels = true;
this.addToRecalculate();
break;
}
}
},
getObjectType: function() getObjectType: function()
{ {
...@@ -1137,6 +1206,10 @@ CChartSpace.prototype = ...@@ -1137,6 +1206,10 @@ CChartSpace.prototype =
{ {
History.Add(this, {Type: historyitem_ChartSpace_SetChart, oldChart: this.chart, newChart: chart}); History.Add(this, {Type: historyitem_ChartSpace_SetChart, oldChart: this.chart, newChart: chart});
this.chart = chart; this.chart = chart;
if(chart)
{
chart.setParent(this);
}
}, },
setClrMapOvr: function(clrMapOvr) setClrMapOvr: function(clrMapOvr)
{ {
...@@ -2300,6 +2373,10 @@ CChartSpace.prototype = ...@@ -2300,6 +2373,10 @@ CChartSpace.prototype =
/*new recalc*/ /*new recalc*/
y_ax.labels = null; y_ax.labels = null;
x_ax.labels = null; x_ax.labels = null;
y_ax.posX = null;
x_ax.posY = null;
y_ax.posY = null;
x_ax.posX = null;
var sizes = this.getChartSizes(); var sizes = this.getChartSizes();
var rect = {x: sizes.startX, y:sizes.startY, w:sizes.w, h: sizes.h}; var rect = {x: sizes.startX, y:sizes.startY, w:sizes.w, h: sizes.h};
var arr_val = this.getValAxisValues(); var arr_val = this.getValAxisValues();
...@@ -2950,6 +3027,11 @@ CChartSpace.prototype = ...@@ -2950,6 +3027,11 @@ CChartSpace.prototype =
{ {
val_ax.labels = null; val_ax.labels = null;
cat_ax.labels = null; cat_ax.labels = null;
val_ax.posX = null;
cat_ax.posY = null;
val_ax.posY = null;
cat_ax.posX = null;
var sizes = this.getChartSizes(); var sizes = this.getChartSizes();
var rect = {x: sizes.startX, y:sizes.startY, w:sizes.w, h: sizes.h}; var rect = {x: sizes.startX, y:sizes.startY, w:sizes.w, h: sizes.h};
var arr_val = this.getValAxisValues(); var arr_val = this.getValAxisValues();
...@@ -3978,6 +4060,11 @@ CChartSpace.prototype = ...@@ -3978,6 +4060,11 @@ CChartSpace.prototype =
/*---------------------new version---------------------------------------*/ /*---------------------new version---------------------------------------*/
val_ax.labels = null; val_ax.labels = null;
cat_ax.labels = null; cat_ax.labels = null;
val_ax.posX = null;
cat_ax.posY = null;
val_ax.posY = null;
cat_ax.posX = null;
var sizes = this.getChartSizes(); var sizes = this.getChartSizes();
var rect = {x: sizes.startX, y:sizes.startY, w:sizes.w, h: sizes.h}; var rect = {x: sizes.startX, y:sizes.startY, w:sizes.w, h: sizes.h};
var arr_val = this.getValAxisValues(); var arr_val = this.getValAxisValues();
...@@ -7670,6 +7757,7 @@ CChartSpace.prototype = ...@@ -7670,6 +7757,7 @@ CChartSpace.prototype =
case historyitem_ChartSpace_SetStyle: case historyitem_ChartSpace_SetStyle:
{ {
this.style = readLong(r); this.style = readLong(r);
this.handleUpdateStyle();
break; break;
} }
case historyitem_ChartSpace_SetTxPr: case historyitem_ChartSpace_SetTxPr:
......
"use strict"; "use strict";
var historyitem_ChartFormatSetChart = 1; var historyitem_ChartFormatSetChart = 1001;
var historyitem_AutoShapes_SetWorksheet = 2; var historyitem_AutoShapes_SetWorksheet = 1002;
var historyitem_AutoShapes_AddToDrawingObjects = 3; var historyitem_AutoShapes_AddToDrawingObjects = 1003;
var historyitem_AutoShapes_RemoveFromDrawingObjects = 4; var historyitem_AutoShapes_RemoveFromDrawingObjects = 1004;
var historyitem_CommonChart_RemoveSeries = 5; var historyitem_CommonChart_RemoveSeries = 1005;
var historyitem_CommonSeries_RemoveDPt = 6; var historyitem_CommonSeries_RemoveDPt = 1006;
var historyitem_CommonLit_RemoveDPt = 6; var historyitem_CommonLit_RemoveDPt = 1007;
var historyitem_CommonChartFormat_SetParent = 1008;
var historyitem_ColorMod_SetName = 2001; var historyitem_ColorMod_SetName = 2001;
var historyitem_ColorMod_SetVal = 2002; var historyitem_ColorMod_SetVal = 2002;
var historyitem_ColorModifiers_AddColorMod = 2003; var historyitem_ColorModifiers_AddColorMod = 2003;
......
...@@ -102,10 +102,15 @@ CChartSpace.prototype.handleUpdatePosition = function() ...@@ -102,10 +102,15 @@ CChartSpace.prototype.handleUpdatePosition = function()
}; };
CChartSpace.prototype.handleUpdateExtents = function() CChartSpace.prototype.handleUpdateExtents = function()
{ {
this.recalcChart(); this.recalcInfo.recalculateChart = true;
this.recalcBounds(); this.recalcInfo.recalculateSeriesColors = true;
this.recalcDLbls(); this.recalcInfo.recalculateDLbls = true;
this.setRecalculateInfo(); this.recalcInfo.recalculateAxisLabels = true;
this.recalcInfo.dataLbls.length = 0;
this.recalcInfo.axisLabels.length = 0;
this.recalcInfo.recalculateAxisVal = true;
this.recalcInfo.recalculateLegend = true;
this.chartObj = null;
this.addToRecalculate(); this.addToRecalculate();
}; };
CChartSpace.prototype.handleUpdateFlip = function() CChartSpace.prototype.handleUpdateFlip = function()
...@@ -122,7 +127,10 @@ CChartSpace.prototype.handleUpdateChart = function() ...@@ -122,7 +127,10 @@ CChartSpace.prototype.handleUpdateChart = function()
}; };
CChartSpace.prototype.handleUpdateStyle = function() CChartSpace.prototype.handleUpdateStyle = function()
{ {
this.setRecalculateInfo(); this.recalcInfo.recalculateSeriesColors = true;
this.recalcInfo.recalculateLegend = true;
this.recalcInfo.recalculatePlotAreaBrush = true;
this.recalcInfo.recalculatePlotAreaPen = true;
this.addToRecalculate(); this.addToRecalculate();
}; };
CChartSpace.prototype.handleUpdateFill = function() CChartSpace.prototype.handleUpdateFill = function()
...@@ -283,6 +291,7 @@ CChartSpace.prototype.recalculate = function() ...@@ -283,6 +291,7 @@ CChartSpace.prototype.recalculate = function()
this.recalcInfo.recalculateUpDownBars = false; this.recalcInfo.recalculateUpDownBars = false;
} }
var b_recalc_legend = false; var b_recalc_legend = false;
if(this.recalcInfo.recalculateLegend) if(this.recalcInfo.recalculateLegend)
{ {
...@@ -299,14 +308,14 @@ CChartSpace.prototype.recalculate = function() ...@@ -299,14 +308,14 @@ CChartSpace.prototype.recalculate = function()
b_recalc_labels = true; b_recalc_labels = true;
} }
if(this.recalcInfo.recalculateAxisVal) if(this.recalcInfo.recalculateAxisVal)
{ {
this.recalculateAxis(); this.recalculateAxis();
this.recalcInfo.recalculateAxisVal = false; this.recalcInfo.recalculateAxisVal = false;
} }
if(this.recalcInfo.recalculatePenBrush) if(this.recalcInfo.recalculatePenBrush)
{ {
this.recalculatePenBrush(); this.recalculatePenBrush();
......
...@@ -168,8 +168,10 @@ CChartSpace.prototype.handleUpdateChart = function() ...@@ -168,8 +168,10 @@ CChartSpace.prototype.handleUpdateChart = function()
}; };
CChartSpace.prototype.handleUpdateStyle = function() CChartSpace.prototype.handleUpdateStyle = function()
{ {
this.setRecalculateInfo(); this.recalcInfo.recalculateSeriesColors = true;
this.recalcInfo.recalculateLegend = true;
this.recalcInfo.recalculatePlotAreaBrush = true;
this.recalcInfo.recalculatePlotAreaPen = true;
this.addToRecalculate(); this.addToRecalculate();
}; };
CChartSpace.prototype.canGroup = CShape.prototype.canGroup; CChartSpace.prototype.canGroup = CShape.prototype.canGroup;
......
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