Commit 92c37c1a 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@54580 954022d7-b5bf-4e40-9824-e11837661b57
parent 47e429d2
...@@ -5144,13 +5144,11 @@ CGeometry2.prototype = ...@@ -5144,13 +5144,11 @@ CGeometry2.prototype =
AddPath: function(path) AddPath: function(path)
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Add_Path, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataAddObject(path.Id)), null);
this.pathLst.push(path); this.pathLst.push(path);
}, },
AddRect: function(l, t, r, b) AddRect: function(l, t, r, b)
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_Add_GeometryRect, null, null, new UndoRedoDataGraphicObjects(this.Id, new UndoRedoDataAddGeometryRect(l, t, r, b)), null);
this.rectS = {}; this.rectS = {};
this.rectS.l = l; this.rectS.l = l;
this.rectS.t = t; this.rectS.t = t;
......
...@@ -3884,8 +3884,11 @@ function DrawingObjects() { ...@@ -3884,8 +3884,11 @@ function DrawingObjects() {
if ( _range ) if ( _range )
chart.range.intervalObject = _range; chart.range.intervalObject = _range;
ExecuteNoHistory(function()
{
chart.rebuildSeries(); chart.rebuildSeries();
chart.worksheet = worksheet; // Для формул серий chart.worksheet = worksheet; // Для формул серий
}, this, []);
return this.controller.addChartDrawingObject(chart, options); return this.controller.addChartDrawingObject(chart, options);
} }
......
...@@ -614,6 +614,8 @@ DrawingObjectsController.prototype = ...@@ -614,6 +614,8 @@ DrawingObjectsController.prototype =
} }
if(i === this.selectedObjects.length) if(i === this.selectedObjects.length)
this.selectedObjects.push(object); this.selectedObjects.push(object);
if(this.selectedObjects.length === 1 && this.selectedObjects[0] instanceof CChartSpace)
window["asc"]["editor"].handlers.trigger("asc_onSelectChart", this.selectedObjects[0]);
}, },
...@@ -1193,21 +1195,10 @@ DrawingObjectsController.prototype = ...@@ -1193,21 +1195,10 @@ DrawingObjectsController.prototype =
{ {
var chart = null; var chart = null;
for (var i = 0; i < this.selectedObjects.length; i++) { for (var i = 0; i < this.selectedObjects.length; i++) {
if ( this.selectedObjects[i].isChart() ) { if ( this.selectedObjects[i].isChart() )
if ( chart != null ) {
return null; this.selectedObjects[i].drObjects = this;
this.selectedObjects[i].syncAscChart(); return this.selectedObjects[i];
chart = new asc_CChart(this.selectedObjects[0].chart);
}
if ( this.selectedObjects[i].isGroup() ) {
for ( var j = 0; j < this.selectedObjects[i].arrGraphicObjects.length; j++ ) {
if ( this.selectedObjects[i].arrGraphicObjects[j].isChart() ) {
if ( chart != null )
return null;
this.selectedObjects[i].arrGraphicObjects[j].syncAscChart();
chart = new asc_CChart(this.selectedObjects[i].arrGraphicObjects[j].chart);
}
}
} }
} }
return chart; return chart;
...@@ -1225,32 +1216,265 @@ DrawingObjectsController.prototype = ...@@ -1225,32 +1216,265 @@ DrawingObjectsController.prototype =
}, },
editChartCallback: function(chart)
getSelectedObjectsByTypes: function()
{ {
if(this.selectedObjects.length === 1) var ret = {shapes: [], images: [], groups: [], charts: []};
var selected_objects = this.curState.group ? this.curState.group.selectedObjects : this.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i)
{ {
if(this.selectedObjects[0].isChart()) var drawing = selected_objects[i];
var type = drawing.getObjectType();
switch(type)
{ {
this.selectedObjects[0].setChart(chart); case historyitem_type_Shape:
this.selectedObjects[0].recalculate(); {
this.drawingObjects.showDrawingObjects(true); ret.shapes.push(drawing);
return; break;
}
case historyitem_type_ImageShape:
{
ret.images.push(drawing);
break;
}
case historyitem_type_GroupShape:
{
ret.groups.push(drawing);
break;
}
case historyitem_type_ChartSpace:
{
ret.charts.push(drawing);
break;
}
}
}
return ret;
},
editChartCallback: function(chartSettings)
{
var objects_by_types = this.getSelectedObjectsByTypes();
if(objects_by_types.charts.length === 1)
{
//Style Index
var chart_space = objects_by_types.charts[0];
var style_index = chartSettings.getStyle();
if(isRealNumber(style_index) && style_index > 0 && style_index < 49)
{
chart_space.setStyle(style_index);
} }
if(isRealObject(this.curState.group))
//Title Settings
var chart = chart_space.chart;
var title_show_settings = chartSettings.getTitle();
if(title_show_settings === c_oAscChartTitleShowSettings.none)
{ {
if(this.curState.group.selectedObjects.length === 1) if(chart.title)
{ {
if(this.curState.group.selectedObjects[0].isChart()) chart.setTitle(null);
}
}
else if(title_show_settings === c_oAscChartTitleShowSettings.noOverlay
|| title_show_settings === c_oAscChartTitleShowSettings.overlay)
{
if(!chart.title)
{
chart.setTitle(new CTitle());
}
chart.title.setOverlay(title_show_settings === c_oAscChartTitleShowSettings.overlay);
}
//Row/Cols
if(chartSettings.getRowCols() !== null)
{
chart_space.swapData();
}
var plot_area = chart.plotArea;
//horAxisLabel
var hor_axis_label_setting = chartSettings.getHorAxisLabel();
if(hor_axis_label_setting !== null)
{
var hor_axis = plot_area.getHorizontalAxis();
if(hor_axis)
{
switch (hor_axis_label_setting)
{
case c_oAscChartHorAxisLabelShowSettings.none:
{
hor_axis.setTitle(null);
break;
}
case c_oAscChartHorAxisLabelShowSettings.noOverlay:
{
if(!hor_axis.title)
{
hor_axis.setTitle(new CTitle());
}
if(hor_axis.title.overlay)
hor_axis.title.setOverlay(false);
break;
}
}
}
}
//vertAxis
var vert_axis_labels_settings = chartSettings.getVertAxisLabel();
if(vert_axis_labels_settings !== null)
{
var vert_axis = plot_area.getVerticalAxis();
if(vert_axis)
{
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();
vert_axis.title.txPr.bodyPr.setRot(vert_axis_labels_settings === c_oAscChartVertAxisLabelShowSettings.rotated ? Math.PI/2 : 0);
vert_axis.title.txPr.bodyPr.setVert(nVertTThorz);
}
}
}
}
}
//legend
var legend_pos_settings = chartSettings.getLegendPos();
if(legend_pos_settings !== null)
{
if(legend_pos_settings === c_oAscChartLegendShowSettings.none)
{
if(chart.legend)
{
chart.setLegend(null);
}
}
else
{
if(!chart.legend)
{
chart.setLegend(new CLegend());
}
if(isRealNumber(LEGEND_POS_MAP[legend_pos_settings]))
{
chart.legend.setLegendPos(LEGEND_POS_MAP[legend_pos_settings]);
if(legend_pos_settings === c_oAscChartLegendShowSettings.leftOverlay
|| legend_pos_settings === c_oAscChartLegendShowSettings.rightOverlay)
{
if(chart.legend.overlay !== true)
{
chart.legend.setOverlay(true);
}
}
}
}
}
//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.getHorizontalAxis(), chartSettings.getHorGridLines());
setAxisGridLines(plot_area.getVerticalAxis(), chartSettings.getVertGridLines());
var chart_type = plot_area.chart;
//Data Labels
var data_labels_pos_setting = chartSettings.getDataLabelsPos();
if(isRealNumber(data_labels_pos_setting))
{
if(data_labels_pos_setting === c_oAscChartDataLabelsPos.none)
{
chart_type.setDLbls(null);
}
else
{
if(isRealNumber(DLBL_POS_DEFINES_MAP[data_labels_pos_setting]))
{ {
this.curState.group.selectedObjects[0].setChart(chart);
this.curState.group.selectedObjects[0].recalculate();
this.drawingObjects.showDrawingObjects(true);
return;
if(!chart_type.dLbls)
{
var d_lbls = new CDLbls();
d_lbls.setShowVal(true);
chart_type.setDLbls(d_lbls);
}
chart_type.dLbls.setDLblPos(DLBL_POS_DEFINES_MAP[data_labels_pos_setting]);
} }
} }
} }
//Vert Axis
chart_space.addToRecalculate(); //TODO
chart_space.setRecalculateInfo();//TODO: обязательно переделать
this.startRecalculate();
} }
}, },
...@@ -1720,7 +1944,7 @@ DrawingObjectsController.prototype = ...@@ -1720,7 +1944,7 @@ DrawingObjectsController.prototype =
max_y = bounds.maxY; max_y = bounds.maxY;
min_x = bounds.minX; min_x = bounds.minX;
min_y = bounds.minY; min_y = bounds.minY;
for(i = 1; i < grouped_objects.length; ++i) for(var i = 1; i < grouped_objects.length; ++i)
{ {
bounds = grouped_objects[i].getBoundsInGroup(); bounds = grouped_objects[i].getBoundsInGroup();
if(max_x < bounds.maxX) if(max_x < bounds.maxX)
......
...@@ -3715,6 +3715,19 @@ var DLBL_POS_OUT_END = 6; ...@@ -3715,6 +3715,19 @@ var DLBL_POS_OUT_END = 6;
var DLBL_POS_R = 7; var DLBL_POS_R = 7;
var DLBL_POS_T = 8; var DLBL_POS_T = 8;
var DLBL_POS_DEFINES_MAP = [];
DLBL_POS_DEFINES_MAP[c_oAscChartDataLabelsPos.b] = DLBL_POS_B;
DLBL_POS_DEFINES_MAP[c_oAscChartDataLabelsPos.bestFit] = DLBL_POS_BEST_FIT;
DLBL_POS_DEFINES_MAP[c_oAscChartDataLabelsPos.ctr] = DLBL_POS_CTR;
DLBL_POS_DEFINES_MAP[c_oAscChartDataLabelsPos.inBase] = DLBL_POS_IN_BASE;
DLBL_POS_DEFINES_MAP[c_oAscChartDataLabelsPos.inEnd] = DLBL_POS_IN_END;
DLBL_POS_DEFINES_MAP[c_oAscChartDataLabelsPos.l] = DLBL_POS_L;
DLBL_POS_DEFINES_MAP[c_oAscChartDataLabelsPos.outEnd] = DLBL_POS_OUT_END;
DLBL_POS_DEFINES_MAP[c_oAscChartDataLabelsPos.r] = DLBL_POS_R;
DLBL_POS_DEFINES_MAP[c_oAscChartDataLabelsPos.t] = DLBL_POS_T;
function CDLbl() function CDLbl()
{ {
this.bDelete = null; this.bDelete = null;
...@@ -4044,21 +4057,21 @@ CDLbl.prototype = ...@@ -4044,21 +4057,21 @@ CDLbl.prototype =
_alpha = Math.atan2(_dy_t, _dx_t); _alpha = Math.atan2(_dy_t, _dx_t);
if (_body_pr.vert === nVertTTvert) { if (_body_pr.vert === nVertTTvert) {
if (_dx_lt_rb * _dy_t - _dy_lt_rb * _dx_t <= 0) { if (_dx_lt_rb * _dy_t - _dy_lt_rb * _dx_t <= 0) {
global_MatrixTransformer.RotateRadAppend(_text_transform, -_alpha - Math.PI * 0.5 - (isRealNumber(_body_pr.rot) ? _body_pr.rot : 0)); global_MatrixTransformer.RotateRadAppend(_text_transform, -_alpha - Math.PI * 0.5 + (isRealNumber(_body_pr.rot) ? _body_pr.rot : 0));
global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_rt, _t_y_rt); global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_rt, _t_y_rt);
} }
else { else {
global_MatrixTransformer.RotateRadAppend(_text_transform, Math.PI * 0.5 - _alpha - (isRealNumber(_body_pr.rot) ? _body_pr.rot : 0)); global_MatrixTransformer.RotateRadAppend(_text_transform, Math.PI * 0.5 - _alpha + (isRealNumber(_body_pr.rot) ? _body_pr.rot : 0));
global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_lt, _t_y_lt); global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_lt, _t_y_lt);
} }
} }
else { else {
if (_dx_lt_rb * _dy_t - _dy_lt_rb * _dx_t <= 0) { if (_dx_lt_rb * _dy_t - _dy_lt_rb * _dx_t <= 0) {
global_MatrixTransformer.RotateRadAppend(_text_transform, -_alpha - Math.PI * 1.5 - (isRealNumber(_body_pr.rot) ? _body_pr.rot : 0)); global_MatrixTransformer.RotateRadAppend(_text_transform, -_alpha - Math.PI * 1.5 + (isRealNumber(_body_pr.rot) ? _body_pr.rot : 0));
global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_lb, _t_y_lb); global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_lb, _t_y_lb);
} }
else { else {
global_MatrixTransformer.RotateRadAppend(_text_transform, -Math.PI * 0.5 - _alpha - (isRealNumber(_body_pr.rot) ? _body_pr.rot : 0)); global_MatrixTransformer.RotateRadAppend(_text_transform, -Math.PI * 0.5 - _alpha + (isRealNumber(_body_pr.rot) ? _body_pr.rot : 0));
global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_rb, _t_y_rb); global_MatrixTransformer.TranslateAppend(_text_transform, _t_x_rb, _t_y_rb);
} }
} }
...@@ -4416,8 +4429,23 @@ CDLbl.prototype = ...@@ -4416,8 +4429,23 @@ CDLbl.prototype =
} }
default: default:
{ {
this.extX = max_width + 1.25; var _rot = isRealNumber(bodyPr.rot) ? bodyPr.rot : 0;
this.extY = this.txBody.content.Get_SummaryHeight() + SCALE_INSET_COEFF; var t = new CMatrix();
global_MatrixTransformer.RotateRadAppend(t, -_rot);
var w, h, x0, y0, x1, y1, x2, y2, x3, y3;
w = max_width;
h = this.txBody.content.Get_SummaryHeight();
x0 = 0;
y0 = 0;
x1 = t.TransformPointX(w, 0);
y1 = t.TransformPointY(w, 0);
x2 = t.TransformPointX(w, h);
y2 = t.TransformPointY(w, h);
x3 = t.TransformPointX(0, h);
y3 = t.TransformPointY(0, h);
this.extX = Math.max(x0, x1, x2, x3) - Math.min(x0, x1, x2, x3) + 1.25;
this.extY = Math.max(y0, y1, y2, y3) - Math.min(y0, y1, y2, y3) + SCALE_INSET_COEFF;
this.x = 0; this.x = 0;
this.y = 0; this.y = 0;
break; break;
...@@ -7214,6 +7242,16 @@ var LEGEND_POS_R = 2; ...@@ -7214,6 +7242,16 @@ var LEGEND_POS_R = 2;
var LEGEND_POS_B = 3; var LEGEND_POS_B = 3;
var LEGEND_POS_TR = 4; var LEGEND_POS_TR = 4;
var LEGEND_POS_MAP = [];
LEGEND_POS_MAP[c_oAscChartLegendShowSettings.left] = LEGEND_POS_L;
LEGEND_POS_MAP[c_oAscChartLegendShowSettings.top] = LEGEND_POS_T;
LEGEND_POS_MAP[c_oAscChartLegendShowSettings.right] = LEGEND_POS_R;
LEGEND_POS_MAP[c_oAscChartLegendShowSettings.bottom] = LEGEND_POS_B;
LEGEND_POS_MAP[c_oAscChartLegendShowSettings.leftOverlay] = LEGEND_POS_L;
LEGEND_POS_MAP[c_oAscChartLegendShowSettings.rightOverlay] = LEGEND_POS_R;
function CLegend() function CLegend()
{ {
this.layout = null; this.layout = null;
...@@ -10812,13 +10850,18 @@ CPivotFmt.prototype = ...@@ -10812,13 +10850,18 @@ CPivotFmt.prototype =
function CPlotArea() function CPlotArea()
{ {
this.chart = null; this.chart = null;
this.catAx = null;
this.dateAx = null;
this.dTable = null; this.dTable = null;
this.layout = null; this.layout = null;
this.serAx = null; this.serAx = null;
this.spPr = null; this.spPr = null;
//ТоDo
this.valAx = null; this.valAx = null;
this.catAx = null;
this.dateAx = null;
//
this.axis = [];
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id); g_oTableId.Add(this, this.Id);
...@@ -10847,6 +10890,19 @@ CPlotArea.prototype = ...@@ -10847,6 +10890,19 @@ CPlotArea.prototype =
this.Id = r.GetString2(); this.Id = r.GetString2();
}, },
addAxis: function(axis)
{
History.Add(this, {Type: historyitem_PlotArea_AddAxis, newPr:axis});
this.axis.push(axis);
//TODO: полей catAx и valAx не должно быть все оси бадут лежать в одном массиве
if(axis instanceof CCatAx)
this.catAx = axis;
if(axis instanceof CValAx)
this.valAx = axis;
},
setChart: function(pr) setChart: function(pr)
{ {
History.Add(this, {Type: historyitem_PlotArea_SetChart, oldPr: this.chart, newPr:pr}); History.Add(this, {Type: historyitem_PlotArea_SetChart, oldPr: this.chart, newPr:pr});
...@@ -10895,6 +10951,18 @@ CPlotArea.prototype = ...@@ -10895,6 +10951,18 @@ CPlotArea.prototype =
this.valAx = pr; this.valAx = pr;
}, },
getHorizontalAxis: function()
{
return this.catAx; //TODO
},
getVerticalAxis: function()
{
return this.valAx; //TODO
},
Undo: function(data) Undo: function(data)
{ {
switch (data.Type) switch (data.Type)
...@@ -10934,6 +11002,18 @@ CPlotArea.prototype = ...@@ -10934,6 +11002,18 @@ CPlotArea.prototype =
this.valAx = data.oldPr; this.valAx = data.oldPr;
break; break;
} }
case historyitem_PlotArea_AddAxis:
{
for(var i = this.axis.length; i > -1; --i)
{
if(this.axis[i] === data.newPr)
{
this.axis.splice(i, 1);
break;
}
}
break;
}
} }
}, },
...@@ -10976,6 +11056,11 @@ CPlotArea.prototype = ...@@ -10976,6 +11056,11 @@ CPlotArea.prototype =
this.valAx = data.newPr; this.valAx = data.newPr;
break; break;
} }
case historyitem_PlotArea_AddAxis:
{
this.axis.push(data.newPr);
break;
}
} }
}, },
...@@ -10991,6 +11076,7 @@ CPlotArea.prototype = ...@@ -10991,6 +11076,7 @@ CPlotArea.prototype =
case historyitem_PlotArea_SetSerAx: case historyitem_PlotArea_SetSerAx:
case historyitem_PlotArea_SetSpPr: case historyitem_PlotArea_SetSpPr:
case historyitem_PlotArea_SetValAx: case historyitem_PlotArea_SetValAx:
case historyitem_PlotArea_AddAxis:
{ {
writeObject(w, data.newPr); writeObject(w, data.newPr);
break; break;
...@@ -11038,6 +11124,12 @@ CPlotArea.prototype = ...@@ -11038,6 +11124,12 @@ CPlotArea.prototype =
this.valAx = readObject(r); this.valAx = readObject(r);
break; break;
} }
case historyitem_PlotArea_AddAxis:
{
var axis = readObject(r);
this.axis.push(axis);
break;
}
} }
} }
}; };
......
...@@ -1967,9 +1967,9 @@ function CreateLineChart(asc_chart, type) ...@@ -1967,9 +1967,9 @@ function CreateLineChart(asc_chart, type)
var plot_area = chart.plotArea; var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout()); plot_area.setLayout(new CLayout());
plot_area.setChart(new CLineChart()); plot_area.setChart(new CLineChart());
plot_area.setCatAx(new CCatAx()); plot_area.addAxis(new CCatAx());
plot_area.catAx.setTitle(new CTitle()); plot_area.catAx.setTitle(new CTitle());
plot_area.setValAx(new CValAx()); plot_area.addAxis(new CValAx());
plot_area.valAx.setTitle(new CTitle()); plot_area.valAx.setTitle(new CTitle());
var title = plot_area.valAx.title; var title = plot_area.valAx.title;
title.setTxPr(new CTextBody()); title.setTxPr(new CTextBody());
...@@ -2132,8 +2132,8 @@ function CreateBarChart(asc_chart, type) ...@@ -2132,8 +2132,8 @@ function CreateBarChart(asc_chart, type)
var plot_area = chart.plotArea; var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout()); plot_area.setLayout(new CLayout());
plot_area.setChart(new CBarChart()); plot_area.setChart(new CBarChart());
plot_area.setCatAx(new CCatAx()); plot_area.addAxis(new CCatAx());
plot_area.setValAx(new CValAx()); plot_area.addAxis(new CValAx());
var bar_chart = plot_area.chart; var bar_chart = plot_area.chart;
bar_chart.setBarDir(BAR_DIR_COL); bar_chart.setBarDir(BAR_DIR_COL);
bar_chart.setGrouping(type); bar_chart.setGrouping(type);
...@@ -2284,8 +2284,8 @@ function CreateHBarChart(asc_chart, type) ...@@ -2284,8 +2284,8 @@ function CreateHBarChart(asc_chart, type)
var plot_area = chart.plotArea; var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout()); plot_area.setLayout(new CLayout());
plot_area.setChart(new CBarChart()); plot_area.setChart(new CBarChart());
plot_area.setCatAx(new CCatAx()); plot_area.addAxis(new CCatAx());
plot_area.setValAx(new CValAx()); plot_area.addAxis(new CValAx());
var bar_chart = plot_area.chart; var bar_chart = plot_area.chart;
bar_chart.setBarDir(BAR_DIR_BAR); bar_chart.setBarDir(BAR_DIR_BAR);
bar_chart.setGrouping(type); bar_chart.setGrouping(type);
...@@ -2439,8 +2439,8 @@ function CreateAreaChart(asc_chart, type) ...@@ -2439,8 +2439,8 @@ function CreateAreaChart(asc_chart, type)
var plot_area = chart.plotArea; var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout()); plot_area.setLayout(new CLayout());
plot_area.setChart(new CAreaChart()); plot_area.setChart(new CAreaChart());
plot_area.setCatAx(new CCatAx()); plot_area.addAxis(new CCatAx());
plot_area.setValAx(new CValAx()); plot_area.addAxis(new CValAx());
var area_chart = plot_area.chart; var area_chart = plot_area.chart;
area_chart.setGrouping(GROUPING_STANDARD); area_chart.setGrouping(GROUPING_STANDARD);
area_chart.setVaryColors(false); area_chart.setVaryColors(false);
...@@ -2589,8 +2589,8 @@ function CreatePieChart(asc_chart, type) ...@@ -2589,8 +2589,8 @@ function CreatePieChart(asc_chart, type)
plot_area.setChart(new CPieChart()); plot_area.setChart(new CPieChart());
var pie_chart = plot_area.chart; var pie_chart = plot_area.chart;
pie_chart.setVaryColors(true); pie_chart.setVaryColors(true);
plot_area.setCatAx(new CCatAx()); plot_area.addAxis(new CCatAx());
plot_area.setValAx(new CValAx()); plot_area.addAxis(new CValAx());
var parsedHeaders = asc_chart.parseSeriesHeaders(); var parsedHeaders = asc_chart.parseSeriesHeaders();
for(var i = 0; i < asc_series.length; ++i) for(var i = 0; i < asc_series.length; ++i)
{ {
...@@ -2702,8 +2702,8 @@ function CreateScatterChart(asc_chart) ...@@ -2702,8 +2702,8 @@ function CreateScatterChart(asc_chart)
var scatter_chart = plot_area.chart; var scatter_chart = plot_area.chart;
scatter_chart.setScatterStyle(SCATTER_STYLE_LINE_MARKER); scatter_chart.setScatterStyle(SCATTER_STYLE_LINE_MARKER);
scatter_chart.setVaryColors(false); scatter_chart.setVaryColors(false);
plot_area.setCatAx(new CValAx()); plot_area.addAxis(new CValAx());
plot_area.setValAx(new CValAx()); plot_area.addAxis(new CValAx());
var first_series = asc_series.length > 1 ? asc_series[0] : null; var first_series = asc_series.length > 1 ? asc_series[0] : null;
var start_index = asc_series.length > 1 ? 1 : 0; var start_index = asc_series.length > 1 ? 1 : 0;
...@@ -2862,8 +2862,8 @@ function CreateStockChart(asc_chart) ...@@ -2862,8 +2862,8 @@ function CreateStockChart(asc_chart)
var plot_area = chart.plotArea; var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout()); plot_area.setLayout(new CLayout());
plot_area.setChart(new CStockChart()); plot_area.setChart(new CStockChart());
plot_area.setCatAx(new CCatAx()); plot_area.addAxis(new CCatAx());
plot_area.setValAx(new CValAx()); plot_area.addAxis(new CValAx());
var line_chart = plot_area.chart; var line_chart = plot_area.chart;
line_chart.setDLbls(new CDLbls()); line_chart.setDLbls(new CDLbls());
line_chart.addAxId(plot_area.catAx); line_chart.addAxId(plot_area.catAx);
......
...@@ -141,6 +141,7 @@ var historyitem_PlotArea_SetLayout = 2137; ...@@ -141,6 +141,7 @@ var historyitem_PlotArea_SetLayout = 2137;
var historyitem_PlotArea_SetSerAx = 2138; var historyitem_PlotArea_SetSerAx = 2138;
var historyitem_PlotArea_SetSpPr = 2139; var historyitem_PlotArea_SetSpPr = 2139;
var historyitem_PlotArea_SetValAx = 2140; var historyitem_PlotArea_SetValAx = 2140;
var historyitem_PlotArea_AddAxis = 2141;
var historyitem_Axis_SetType = 2141; var historyitem_Axis_SetType = 2141;
var historyitem_Axis_SetAuto = 2142; var historyitem_Axis_SetAuto = 2142;
var historyitem_Axis_SetAxId = 2143; var historyitem_Axis_SetAxId = 2143;
......
...@@ -172,11 +172,25 @@ function ExecuteNoHistory(f, oThis, args) ...@@ -172,11 +172,25 @@ function ExecuteNoHistory(f, oThis, args)
{ {
History.TurnOff(); History.TurnOff();
} }
var b_table_id = false;
if(g_oTableId && !g_oTableId.m_bTurnOff)
{
g_oTableId.m_bTurnOff = true;
b_table_id = true;
}
var ret = f.apply(oThis, args); var ret = f.apply(oThis, args);
if(is_on) if(is_on)
{ {
History.TurnOn(); History.TurnOn();
} }
if(b_table_id)
{
g_oTableId.m_bTurnOff = false;
}
return ret; return ret;
} }
......
...@@ -85,6 +85,8 @@ function CreatePenBrushForChartTrack() ...@@ -85,6 +85,8 @@ function CreatePenBrushForChartTrack()
function ResizeTrackShapeImage(originalObject, cardDirection) function ResizeTrackShapeImage(originalObject, cardDirection)
{ {
ExecuteNoHistory(function()
{
this.originalObject = originalObject; this.originalObject = originalObject;
this.numberHandle = originalObject.getNumByCardDirection(cardDirection); this.numberHandle = originalObject.getNumByCardDirection(cardDirection);
...@@ -700,10 +702,13 @@ function ResizeTrackShapeImage(originalObject, cardDirection) ...@@ -700,10 +702,13 @@ function ResizeTrackShapeImage(originalObject, cardDirection)
xfrm.setFlipH(this.resizedflipH); xfrm.setFlipH(this.resizedflipH);
xfrm.setFlipV(this.resizedflipV); xfrm.setFlipV(this.resizedflipV);
}; };
}, this, []);
} }
function ResizeTrackGroup(originalObject, cardDirection, parentTrack) function ResizeTrackGroup(originalObject, cardDirection, parentTrack)
{ {
ExecuteNoHistory(function()
{
this.original = originalObject; this.original = originalObject;
this.originalObject = originalObject; this.originalObject = originalObject;
...@@ -1337,12 +1342,15 @@ function ResizeTrackGroup(originalObject, cardDirection, parentTrack) ...@@ -1337,12 +1342,15 @@ function ResizeTrackGroup(originalObject, cardDirection, parentTrack)
} }
}; };
}, this, []);
} }
function ShapeForResizeInGroup(originalObject, parentTrack) function ShapeForResizeInGroup(originalObject, parentTrack)
{ {
ExecuteNoHistory(function()
{
this.originalObject = originalObject; this.originalObject = originalObject;
this.parentTrack = parentTrack; this.parentTrack = parentTrack;
this.x = originalObject.x; this.x = originalObject.x;
...@@ -1444,4 +1452,5 @@ function ShapeForResizeInGroup(originalObject, parentTrack) ...@@ -1444,4 +1452,5 @@ function ShapeForResizeInGroup(originalObject, parentTrack)
if(this.parentTrack) if(this.parentTrack)
global_MatrixTransformer.MultiplyAppend(t, this.parentTrack.transform); global_MatrixTransformer.MultiplyAppend(t, this.parentTrack.transform);
}; };
}, this, []);
} }
...@@ -188,7 +188,186 @@ ...@@ -188,7 +188,186 @@
prot["put_b"] = prot.put_b; prot["put_b"] = prot.put_b;
prot["getA"] = prot.getA; prot["getA"] = prot.getA;
prot["get_hex"] = prot.get_hex; prot["get_hex"] = prot.get_hex;
function asc_ChartSettings()
{
this.style = null;
this.title = null;
this.rowCols = null;
this.horAxisLabel = null;
this.vertAxisLabel = null;
this.legendPos = null;
this.dataLabelsPos = null;
this.vertAx = null;
this.horAx = null;
this.horGridLines = null;
this.vertGridLines = null;
} }
asc_ChartSettings.prototype =
{
putStyle: function(index)
{
this.style = index;
},
getStyle: function()
{
return this.style;
},
putTitle: function(v)
{
this.title = v;
},
getTitle: function()
{
return this.title;
},
putRowCols: function(v)
{
this.rowCols = v;
},
getRowCols: function()
{
return this.rowCols;
},
putHorAxisLabel: function(v)
{
this.horAxisLabel = v;
},
putVertAxisLabel: function(v)
{
this.vertAxisLabel = v;
},
putLegendPos: function(v)
{
this.legendPos = v;
},
putDataLabelsPos: function(v)
{
this.dataLabelsPos = v;
},
putCatAx: function(v)
{
this.vertAx = v;
},
putValAx: function(v)
{
this.horAx = v;
},
getHorAxisLabel: function(v)
{
return this.horAxisLabel;
},
getVertAxisLabel: function(v)
{
return this.vertAxisLabel;
},
getLegendPos: function(v)
{
return this.legendPos;
},
getDataLabelsPos: function(v)
{
return this.dataLabelsPos;
},
getVertAx: function(v)
{
return this.vertAx;
},
getHorAx: function(v)
{
return this.horAx;
},
putHorGridLines: function(v)
{
this.horGridLines = v;
},
getHorGridLines: function(v)
{
return this.horGridLines;
},
putVertGridLines: function(v)
{
this.vertGridLines = v;
},
getVertGridLines: function()
{
return this.vertGridLines;
}
};
prot = asc_ChartSettings.prototype;
prot["putStyle"] = prot.putStyle;
prot["putTitle"] = prot.putTitle;
prot["putRowCols"] = prot.putRowCols;
prot["putHorAxisLabel"] = prot.putHorAxisLabel;
prot["putVertAxisLabel"] = prot.putVertAxisLabel;
prot["putLegendPos"] = prot.putLegendPos;
prot["putDataLabelsPos"] = prot.putDataLabelsPos;
prot["putCatAx"] = prot.putCatAx;
prot["putValAx"] = prot.putValAx;
prot["getStyle"] = prot.getStyle;
prot["getTitle"] = prot.getTitle;
prot["getRowCols"] = prot.getRowCols;
prot["getHorAxisLabel"] = prot.getHorAxisLabel;
prot["getVertAxisLabel"] = prot.getVertAxisLabel;
prot["getLegendPos"] = prot.getLegendPos;
prot["getDataLabelsPos"] = prot.getDataLabelsPos;
prot["getHorAx"] = prot.getHorAx;
prot["getVertAx"] = prot.getVertAx;
prot["getHorGridLines"] = prot.getVertGridLines;
prot["putHorGridLines"] = prot.putVertGridLines;
prot["getVertGridLines"] = prot.getVertGridLines;
prot["putVertGridLines"] = prot.putVertGridLines;
window["asc_ChartSettings"] = asc_ChartSettings;
function asc_AxisSettings()
{
this.type = null;
this.settings = null;
}
asc_AxisSettings.prototype =
{
putType: function(val)
{
this.type = val;
},
putSettings: function(val)
{
this.settings = val;
},
getType: function()
{
return this.type;
},
getSettings: function()
{
return this.settings;
}
};
prot = asc_AxisSettings.prototype;
prot["putType"] = prot.putType;
prot["putSettings"] = prot.putSettings;
prot["getType"] = prot.getType;
prot["getSettings"] = prot.getSettings;
window["asc_AxisSettings"] = asc_AxisSettings;
}
)(window); )(window);
var CColor = window["CColor"]; var CColor = window["CColor"];
var asc_ChartSettings = window["asc_ChartSettings"];
var asc_AxisSettings = window["asc_AxisSettings"];
\ No newline at end of file
...@@ -86,3 +86,83 @@ var vertalign_SuperScript = 1; ...@@ -86,3 +86,83 @@ var vertalign_SuperScript = 1;
var vertalign_SubScript = 2; var vertalign_SubScript = 2;
var hdrftr_Header = 0x01; var hdrftr_Header = 0x01;
var hdrftr_Footer = 0x02; var hdrftr_Footer = 0x02;
var c_oAscChartTitleShowSettings =
{
none: 0,
overlay: 1,
noOverlay: 2
};
var c_oAscChartHorAxisLabelShowSettings =
{
none: 0,
noOverlay: 1
};
var c_oAscChartVertAxisLabelShowSettings =
{
none: 0,
rotated: 1,
vertical: 2,
horizontal: 3
};
var c_oAscChartLegendShowSettings =
{
none: 0,
left: 1,
top: 2,
right: 3,
bottom: 4,
leftOverlay: 5,
rightOverlay: 6
};
var c_oAscChartDataLabelsPos =
{
none: 0,
b: 1,
bestFit: 2,
ctr: 3,
inBase: 4,
inEnd: 5,
l: 6,
outEnd: 7,
r: 8,
t: 9
};
var c_oAscChartCatAxisSettings =
{
none: 0,
leftToRight: 1,
rightToLeft: 2,
noLabels: 3
};
var c_oAscChartValAxisSettings =
{
none: 0,
byDefault: 1,
thousands: 2,
millions: 3,
billions: 4,
log: 5
};
var c_oAscAxisTypeSettings =
{
vert: 0,
hor: 1
};
var c_oAscGridLinesSettings =
{
none: 0,
major: 1,
minor: 2,
majorMinor: 3
};
\ No newline at end of file
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