Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add class CAddress #3632

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/Charts/DrawingObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,7 @@ CSparklineView.prototype.setMinMaxValAx = function(minVal, maxVal, oSparklineGro

_this.recalculate = function(all)
{
_this.controller.recalculate2(all);
// _this.controller.recalculate2(all);
};

_this.preCopy = function() {
Expand Down
3,974 changes: 3,974 additions & 0 deletions common/Drawings/Format/ChartEx.js

Large diffs are not rendered by default.

103 changes: 96 additions & 7 deletions common/Drawings/Format/ChartFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@
drawingsChangesMap[AscDFH.historyitem_PlotArea_SetDateAx] = function(oClass, value) {
oClass.dateAx = value;
};
drawingsChangesMap[AscDFH.historyitem_PlotArea_SetIsForChartEx] = function(oClass, value) {
oClass.isForChartEx = value;
};
drawingsChangesMap[AscDFH.historyitem_PlotArea_SetPlotAreaRegion] = function(oClass, value) {
oClass.plotAreaRegion = value;
};
drawingsChangesMap[AscDFH.historyitem_PlotArea_SetDTable] = function(oClass, value) {
oClass.dTable = value;
};
Expand Down Expand Up @@ -553,6 +559,12 @@
oClass.strRef = value;
oClass.onChangeDataRefs();
};
drawingsChangesMap[AscDFH.historyitem_ChartText_SetIsForChartEx] = function(oClass, value) {
oClass.isForChartEx = value;
};
drawingsChangesMap[AscDFH.historyitem_ChartText_SetTxData] = function(oClass, value) {
oClass.txData = value;
};
drawingsChangesMap[AscDFH.historyitem_ChartText_SetRich] = function(oClass, value) {
oClass.rich = value;
};
Expand Down Expand Up @@ -720,6 +732,9 @@
drawingsChangesMap[AscDFH.historyitem_Layout_SetParent] = function(oClass, value) {
oClass.parent = value;
};
drawingsChangesMap[AscDFH.historyitem_Legend_SetIsForChartEx] = function(oClass, value) {
oClass.isForChartEx = value;
};
drawingsChangesMap[AscDFH.historyitem_Legend_SetLayout] = function(oClass, value) {
oClass.layout = value;
};
Expand All @@ -732,6 +747,9 @@
drawingsChangesMap[AscDFH.historyitem_Legend_SetSpPr] = function(oClass, value) {
oClass.spPr = value;
};
drawingsChangesMap[AscDFH.historyitem_Legend_SetAlign] = function(oClass, value) {
oClass.align = value;
};
drawingsChangesMap[AscDFH.historyitem_Legend_SetTxPr] = function(oClass, value) {
oClass.txPr = value;
};
Expand Down Expand Up @@ -1104,6 +1122,15 @@
drawingsChangesMap[AscDFH.historyitem_Title_SetTxPr] = function(oClass, value) {
oClass.txPr = value;
};
drawingsChangesMap[AscDFH.historyitem_Title_SetIsForChartEx] = function(oClass, value) {
oClass.isForChartEx = value;
};
drawingsChangesMap[AscDFH.historyitem_Title_SetAlign] = function(oClass, value) {
oClass.align = value;
};
drawingsChangesMap[AscDFH.historyitem_Title_SetPos] = function(oClass, value) {
oClass.pos = value;
};
drawingsChangesMap[AscDFH.historyitem_Trendline_SetBackward] = function(oClass, value) {
oClass.backward = value;
};
Expand Down Expand Up @@ -1154,6 +1181,9 @@
oClass.numRef = value;
oClass.onChangeDataRefs();
};
drawingsChangesMap[AscDFH.historyitem_Chart_SetIsForChartEx] = function(oClass, value) {
oClass.isForChartEx = value;
};
drawingsChangesMap[AscDFH.historyitem_Chart_SetAutoTitleDeleted] = function(oClass, value) {
oClass.autoTitleDeleted = value;
};
Expand Down Expand Up @@ -1551,6 +1581,7 @@
AscDFH.changesFactory[AscDFH.historyitem_Title_SetOverlay] = window['AscDFH'].CChangesDrawingsBool;
AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetDispEq] = window['AscDFH'].CChangesDrawingsBool;
AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetDispRSqr] = window['AscDFH'].CChangesDrawingsBool;
AscDFH.changesFactory[AscDFH.historyitem_Chart_SetIsForChartEx] = window['AscDFH'].CChangesDrawingsBool;
AscDFH.changesFactory[AscDFH.historyitem_Chart_SetAutoTitleDeleted] = window['AscDFH'].CChangesDrawingsBool;
AscDFH.changesFactory[AscDFH.historyitem_Chart_SetPlotVisOnly] = window['AscDFH'].CChangesDrawingsBool;
AscDFH.changesFactory[AscDFH.historyitem_Chart_SetShowDLblsOverMax] = window['AscDFH'].CChangesDrawingsBool;
Expand Down Expand Up @@ -1710,6 +1741,8 @@
AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetTx] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetTxPr] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_DLbl_SetParent] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_PlotArea_SetIsForChartEx] = window['AscDFH'].CChangesDrawingsBool;
AscDFH.changesFactory[AscDFH.historyitem_PlotArea_SetPlotAreaRegion] = window['AscDFH'].CChangesDrawingsObjectNoId;
AscDFH.changesFactory[AscDFH.historyitem_PlotArea_SetDTable] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_PlotArea_SetLayout] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_PlotArea_SetSpPr] = window['AscDFH'].CChangesDrawingsObject;
Expand Down Expand Up @@ -1783,6 +1816,8 @@
AscDFH.changesFactory[AscDFH.historyitem_Cat_SetStrLit] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_Cat_SetStrRef] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_ChartFormatSetChart] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_ChartText_SetIsForChartEx] = window['AscDFH'].CChangesDrawingsBool;
AscDFH.changesFactory[AscDFH.historyitem_ChartText_SetTxData] = window['AscDFH'].CChangesDrawingsObjectNoId;
AscDFH.changesFactory[AscDFH.historyitem_ChartText_SetRich] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_ChartText_SetStrRef] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_DLbls_SetLeaderLines] = window['AscDFH'].CChangesDrawingsObject;
Expand All @@ -1800,8 +1835,10 @@
AscDFH.changesFactory[AscDFH.historyitem_ErrBars_SetMinus] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_ErrBars_SetPlus] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_ErrBars_SetSpPr] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_Legend_SetIsForChartEx] = window['AscDFH'].CChangesDrawingsBool;
AscDFH.changesFactory[AscDFH.historyitem_Legend_SetLayout] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_Legend_SetSpPr] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_Legend_SetAlign] = window['AscDFH'].CChangesDrawingsObjectNoId;
AscDFH.changesFactory[AscDFH.historyitem_Legend_SetTxPr] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_LegendEntry_SetTxPr] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_LineChart_SetDLbls] = window['AscDFH'].CChangesDrawingsObject;
Expand Down Expand Up @@ -1866,6 +1903,9 @@
AscDFH.changesFactory[AscDFH.historyitem_Title_SetSpPr] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_Title_SetTx] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_Title_SetTxPr] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_Title_SetIsForChartEx] = window['AscDFH'].CChangesDrawingsBool;
AscDFH.changesFactory[AscDFH.historyitem_Title_SetAlign] = window['AscDFH'].CChangesDrawingsObjectNoId;
AscDFH.changesFactory[AscDFH.historyitem_Title_SetPos] = window['AscDFH'].CChangesDrawingsObjectNoId;
AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetSpPr] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_Trendline_SetTrendlineLbl] = window['AscDFH'].CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_UpDownBars_SetDownBars] = window['AscDFH'].CChangesDrawingsObject;
Expand Down Expand Up @@ -2005,13 +2045,6 @@
AscDFH.changesFactory[AscDFH.historyitem_MarkerLayoutSymbol] = window['AscDFH'].CChangesDrawingsLong;
AscDFH.changesFactory[AscDFH.historyitem_MarkerLayoutSize] = window['AscDFH'].CChangesDrawingsLong;

AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ChartStyleEntryLnRef] = AscFormat.StyleRef;
AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ChartStyleEntryFillRef] = AscFormat.StyleRef;
AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ChartStyleEntryEffectRef] = AscFormat.StyleRef;
AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ChartStyleEntryFontRef] = AscFormat.FontRef;
AscDFH.drawingsConstructorsMap[AscDFH.historyitem_ChartStyleEntryBodyPr] = AscFormat.CBodyPr;


drawingContentChanges[AscDFH.historyitem_PlotArea_AddAxis] =
drawingContentChanges[AscDFH.historyitem_BarChart_AddAxId] =
drawingContentChanges[AscDFH.historyitem_AreaChart_AddAxId] =
Expand Down Expand Up @@ -4739,6 +4772,8 @@

function CPlotArea() {
CBaseChartObject.call(this);
this.isForChartEx = false;
this.plotAreaRegion = null;
this.charts = [];
this.dTable = null;
this.layout = null;
Expand Down Expand Up @@ -4769,6 +4804,10 @@
InitClass(CPlotArea, CBaseChartObject, AscDFH.historyitem_type_PlotArea);
CPlotArea.prototype.Refresh_RecalcData = function(data) {
switch(data.Type) {
case AscDFH.historyitem_PlotArea_SetPlotAreaRegion:
{
break;
}
case AscDFH.historyitem_CommonChartFormat_SetParent:
{
break;
Expand Down Expand Up @@ -5072,6 +5111,14 @@
}
}
};
CPlotArea.prototype.setIsForChartEx = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_PlotArea_SetIsForChartEx, this.isForChartEx, pr));
this.isForChartEx = pr;
};
CPlotArea.prototype.setPlotAreaRegion = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsObjectNoId(this, AscDFH.historyitem_PlotArea_SetPlotAreaRegion, this.plotAreaRegion, pr));
this.plotAreaRegion = pr;
};
CPlotArea.prototype.setDTable = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_PlotArea_SetDTable, this.dTable, pr));
this.dTable = pr;
Expand Down Expand Up @@ -9193,9 +9240,11 @@

function CChartText() {
CBaseChartObject.call(this);
this.isForChartEx = false;
this.rich = null;
this.strRef = null;
this.chart = null;
this.txData = null;
}

InitClass(CChartText, CBaseChartObject, AscDFH.historyitem_type_ChartText);
Expand Down Expand Up @@ -9232,6 +9281,14 @@
this.strRef = tx.strRef;
}
};
CChartText.prototype.setIsForChartEx = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_ChartText_SetIsForChartEx, this.isForChartEx, pr));
this.isForChartEx = pr;
};
CChartText.prototype.setTxData = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsObjectNoId(this, AscDFH.historyitem_ChartText_SetTxData, this.txData, pr));
this.txData = pr;
};
CChartText.prototype.setRich = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_ChartText_SetRich, this.rich, pr));
this.rich = pr;
Expand Down Expand Up @@ -10071,12 +10128,14 @@

function CLegend() {
CBaseChartObject.call(this);
this.isForChartEx = false;
this.layout = null;
this.legendEntryes = [];
this.legendPos = null;
this.overlay = false;
this.spPr = null;
this.txPr = null;
this.align = null;

this.rot = 0;
this.flipH = false;
Expand Down Expand Up @@ -10330,6 +10389,10 @@
}
}
};
CLegend.prototype.setIsForChartEx = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_Legend_SetIsForChartEx, this.isForChartEx, pr));
this.isForChartEx = pr;
};
CLegend.prototype.setLayout = function(layout) {
History.CanAddChanges() && History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_Legend_SetLayout, this.layout, layout));
this.layout = layout;
Expand All @@ -10355,6 +10418,10 @@
this.spPr = spPr;
this.setParentToChild(spPr);
};
CLegend.prototype.setAlign = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsObjectNoId(this, AscDFH.historyitem_Legend_SetAlign, this.align, pr));
this.align = pr;
};
CLegend.prototype.setTxPr = function(txPr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsObject(this, AscDFH.historyitem_Legend_SetTxPr, this.txPr, txPr));
this.txPr = txPr;
Expand Down Expand Up @@ -13545,6 +13612,7 @@

function CTitle() {
CBaseChartObject.call(this);
this.isForChartEx = false;
this.layout = null;
this.overlay = false;
this.spPr = null;
Expand All @@ -13566,6 +13634,10 @@
this.localTransform = new CMatrix();
this.localTransformText = new CMatrix();

//for chart title only (but not axis title)
this.align = null;
this.pos = null;

this.recalcInfo =
{
recalculateTxBody: true,
Expand Down Expand Up @@ -13868,6 +13940,18 @@
this.invertTransformText = global_MatrixTransformer.Invert(this.transformText);

};
CTitle.prototype.setIsForChartEx = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_Title_SetIsForChartEx, this.isForChartEx, pr));
this.isForChartEx = pr;
};
CTitle.prototype.setAlign = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsObjectNoId(this, AscDFH.historyitem_Title_SetAlign, this.align, pr));
this.align = pr;
};
CTitle.prototype.setPos = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsObjectNoId(this, AscDFH.historyitem_Title_SetPos, this.pos, pr));
this.pos = pr;
};
CTitle.prototype.getParentObjects = function() {
if(this.chart) {
return this.chart.getParentObjects();
Expand Down Expand Up @@ -14680,6 +14764,7 @@

function CChart() {
CBaseChartObject.call(this);
this.isForChartEx = false;
this.autoTitleDeleted = null;
this.backWall = null;
this.dispBlanksAs = null;
Expand Down Expand Up @@ -14831,6 +14916,10 @@
}
return null;
};
CChart.prototype.setIsForChartEx = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_Chart_SetIsForChartEx, this.isForChartEx, pr));
this.isForChartEx = pr;
};
CChart.prototype.setAutoTitleDeleted = function(autoTitleDeleted) {
History.CanAddChanges() && History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_Chart_SetAutoTitleDeleted, this.autoTitleDeleted, autoTitleDeleted));
this.autoTitleDeleted = autoTitleDeleted;
Expand Down
21 changes: 20 additions & 1 deletion common/Drawings/Format/ChartSpace.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ function(window, undefined) {
AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetNvGrFrProps] = CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetThemeOverride] = CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_ShapeSetBDeleted] = CChangesDrawingsBool;
AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetIsForChartEx] = CChangesDrawingsBool;
AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetChartData] = CChangesDrawingsObjectNoId;
AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetParent] = CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetChart] = CChangesDrawingsObject;
AscDFH.changesFactory[AscDFH.historyitem_ChartSpace_SetClrMapOvr] = CChangesDrawingsObject;
Expand Down Expand Up @@ -535,6 +537,12 @@ function(window, undefined) {
drawingsChangesMap[AscDFH.historyitem_ShapeSetBDeleted] = function (oClass, value) {
oClass.bDeleted = value;
};
drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetIsForChartEx] = function(oClass, value) {
oClass.isForChartEx = value;
};
drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetChartData] = function(oClass, value) {
oClass.chartData = value;
};
drawingsChangesMap[AscDFH.historyitem_ChartSpace_SetParent] = function (oClass, value) {
oClass.oldParent = oClass.parent;
oClass.parent = value;
Expand Down Expand Up @@ -1306,6 +1314,7 @@ function(window, undefined) {

function CChartSpace() {
AscFormat.CGraphicObjectBase.call(this);
this.isForChartEx = false;
this.nvGraphicFramePr = null;
this.chart = null;
this.clrMapOvr = null;
Expand All @@ -1323,6 +1332,7 @@ function(window, undefined) {
this.userShapes = [];//userShapes
this.chartStyle = null;
this.chartColors = null;
this.chartData = null;

this.dataRefs = null;
this.pathMemory = new CPathMemory();
Expand Down Expand Up @@ -1363,6 +1373,14 @@ function(window, undefined) {
}
return this.dataRefs;
};
CChartSpace.prototype.setIsForChartEx = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsBool(this, AscDFH.historyitem_ChartSpace_SetIsForChartEx, this.isForChartEx, pr));
this.isForChartEx = pr;
};
CChartSpace.prototype.setChartData = function(pr) {
History.CanAddChanges() && History.Add(new CChangesDrawingsObjectNoId(this, AscDFH.historyitem_ChartSpace_SetChartData, this.chartData, pr));
this.chartData = pr;
};
CChartSpace.prototype.clearDataRefs = function () {
if (this.dataRefs) {
this.dataRefs = null;
Expand Down Expand Up @@ -3713,7 +3731,8 @@ function(window, undefined) {
this.group = group;
};
CChartSpace.prototype.hasCharts = function () {
if (this.chart && this.chart.plotArea && this.chart.plotArea.charts.length > 0) {
if (!this.isForChartEx && this.chart && this.chart.plotArea && this.chart.plotArea.charts.length > 0 ||
this.isForChartEx && this.chart && this.chart.plotArea) {
return true;
}
return false;
Expand Down
Loading
Loading