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 =
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);
},
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.l = l;
this.rectS.t = t;
......
......@@ -3884,8 +3884,11 @@ function DrawingObjects() {
if ( _range )
chart.range.intervalObject = _range;
chart.rebuildSeries();
chart.worksheet = worksheet; // Для формул серий
ExecuteNoHistory(function()
{
chart.rebuildSeries();
chart.worksheet = worksheet; // Для формул серий
}, this, []);
return this.controller.addChartDrawingObject(chart, options);
}
......
This diff is collapsed.
......@@ -3715,6 +3715,19 @@ var DLBL_POS_OUT_END = 6;
var DLBL_POS_R = 7;
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()
{
this.bDelete = null;
......@@ -4044,21 +4057,21 @@ CDLbl.prototype =
_alpha = Math.atan2(_dy_t, _dx_t);
if (_body_pr.vert === nVertTTvert) {
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);
}
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);
}
}
else {
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);
}
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);
}
}
......@@ -4416,8 +4429,23 @@ CDLbl.prototype =
}
default:
{
this.extX = max_width + 1.25;
this.extY = this.txBody.content.Get_SummaryHeight() + SCALE_INSET_COEFF;
var _rot = isRealNumber(bodyPr.rot) ? bodyPr.rot : 0;
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.y = 0;
break;
......@@ -7214,6 +7242,16 @@ var LEGEND_POS_R = 2;
var LEGEND_POS_B = 3;
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()
{
this.layout = null;
......@@ -10812,13 +10850,18 @@ CPivotFmt.prototype =
function CPlotArea()
{
this.chart = null;
this.catAx = null;
this.dateAx = null;
this.dTable = null;
this.layout = null;
this.serAx = null;
this.spPr = null;
//ТоDo
this.valAx = null;
this.catAx = null;
this.dateAx = null;
//
this.axis = [];
this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id);
......@@ -10847,6 +10890,19 @@ CPlotArea.prototype =
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)
{
History.Add(this, {Type: historyitem_PlotArea_SetChart, oldPr: this.chart, newPr:pr});
......@@ -10895,6 +10951,18 @@ CPlotArea.prototype =
this.valAx = pr;
},
getHorizontalAxis: function()
{
return this.catAx; //TODO
},
getVerticalAxis: function()
{
return this.valAx; //TODO
},
Undo: function(data)
{
switch (data.Type)
......@@ -10934,6 +11002,18 @@ CPlotArea.prototype =
this.valAx = data.oldPr;
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 =
this.valAx = data.newPr;
break;
}
case historyitem_PlotArea_AddAxis:
{
this.axis.push(data.newPr);
break;
}
}
},
......@@ -10991,6 +11076,7 @@ CPlotArea.prototype =
case historyitem_PlotArea_SetSerAx:
case historyitem_PlotArea_SetSpPr:
case historyitem_PlotArea_SetValAx:
case historyitem_PlotArea_AddAxis:
{
writeObject(w, data.newPr);
break;
......@@ -11038,6 +11124,12 @@ CPlotArea.prototype =
this.valAx = readObject(r);
break;
}
case historyitem_PlotArea_AddAxis:
{
var axis = readObject(r);
this.axis.push(axis);
break;
}
}
}
};
......
......@@ -1967,9 +1967,9 @@ function CreateLineChart(asc_chart, type)
var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout());
plot_area.setChart(new CLineChart());
plot_area.setCatAx(new CCatAx());
plot_area.addAxis(new CCatAx());
plot_area.catAx.setTitle(new CTitle());
plot_area.setValAx(new CValAx());
plot_area.addAxis(new CValAx());
plot_area.valAx.setTitle(new CTitle());
var title = plot_area.valAx.title;
title.setTxPr(new CTextBody());
......@@ -2132,8 +2132,8 @@ function CreateBarChart(asc_chart, type)
var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout());
plot_area.setChart(new CBarChart());
plot_area.setCatAx(new CCatAx());
plot_area.setValAx(new CValAx());
plot_area.addAxis(new CCatAx());
plot_area.addAxis(new CValAx());
var bar_chart = plot_area.chart;
bar_chart.setBarDir(BAR_DIR_COL);
bar_chart.setGrouping(type);
......@@ -2284,8 +2284,8 @@ function CreateHBarChart(asc_chart, type)
var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout());
plot_area.setChart(new CBarChart());
plot_area.setCatAx(new CCatAx());
plot_area.setValAx(new CValAx());
plot_area.addAxis(new CCatAx());
plot_area.addAxis(new CValAx());
var bar_chart = plot_area.chart;
bar_chart.setBarDir(BAR_DIR_BAR);
bar_chart.setGrouping(type);
......@@ -2439,8 +2439,8 @@ function CreateAreaChart(asc_chart, type)
var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout());
plot_area.setChart(new CAreaChart());
plot_area.setCatAx(new CCatAx());
plot_area.setValAx(new CValAx());
plot_area.addAxis(new CCatAx());
plot_area.addAxis(new CValAx());
var area_chart = plot_area.chart;
area_chart.setGrouping(GROUPING_STANDARD);
area_chart.setVaryColors(false);
......@@ -2589,8 +2589,8 @@ function CreatePieChart(asc_chart, type)
plot_area.setChart(new CPieChart());
var pie_chart = plot_area.chart;
pie_chart.setVaryColors(true);
plot_area.setCatAx(new CCatAx());
plot_area.setValAx(new CValAx());
plot_area.addAxis(new CCatAx());
plot_area.addAxis(new CValAx());
var parsedHeaders = asc_chart.parseSeriesHeaders();
for(var i = 0; i < asc_series.length; ++i)
{
......@@ -2702,8 +2702,8 @@ function CreateScatterChart(asc_chart)
var scatter_chart = plot_area.chart;
scatter_chart.setScatterStyle(SCATTER_STYLE_LINE_MARKER);
scatter_chart.setVaryColors(false);
plot_area.setCatAx(new CValAx());
plot_area.setValAx(new CValAx());
plot_area.addAxis(new CValAx());
plot_area.addAxis(new CValAx());
var first_series = asc_series.length > 1 ? asc_series[0] : null;
var start_index = asc_series.length > 1 ? 1 : 0;
......@@ -2862,8 +2862,8 @@ function CreateStockChart(asc_chart)
var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout());
plot_area.setChart(new CStockChart());
plot_area.setCatAx(new CCatAx());
plot_area.setValAx(new CValAx());
plot_area.addAxis(new CCatAx());
plot_area.addAxis(new CValAx());
var line_chart = plot_area.chart;
line_chart.setDLbls(new CDLbls());
line_chart.addAxId(plot_area.catAx);
......
......@@ -141,6 +141,7 @@ var historyitem_PlotArea_SetLayout = 2137;
var historyitem_PlotArea_SetSerAx = 2138;
var historyitem_PlotArea_SetSpPr = 2139;
var historyitem_PlotArea_SetValAx = 2140;
var historyitem_PlotArea_AddAxis = 2141;
var historyitem_Axis_SetType = 2141;
var historyitem_Axis_SetAuto = 2142;
var historyitem_Axis_SetAxId = 2143;
......
......@@ -172,11 +172,25 @@ function ExecuteNoHistory(f, oThis, args)
{
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);
if(is_on)
{
History.TurnOn();
}
if(b_table_id)
{
g_oTableId.m_bTurnOff = false;
}
return ret;
}
......
......@@ -188,7 +188,186 @@
prot["put_b"] = prot.put_b;
prot["getA"] = prot.getA;
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);
var CColor = window["CColor"];
\ No newline at end of file
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;
var vertalign_SubScript = 2;
var hdrftr_Header = 0x01;
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