Commit 5717ab73 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@54800 954022d7-b5bf-4e40-9824-e11837661b57
parent 3b9a5d34
This diff is collapsed.
This diff is collapsed.
......@@ -1964,7 +1964,7 @@ function CreateLineChart(asc_chart, type)
chart.setShowDLblsOverMax(false);
var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout());
plot_area.setChart(new CLineChart());
plot_area.addChart(new CLineChart());
plot_area.addAxis(new CCatAx());
plot_area.catAx.setTitle(new CTitle());
plot_area.addAxis(new CValAx());
......@@ -1973,7 +1973,7 @@ function CreateLineChart(asc_chart, type)
title.setTxPr(new CTextBody());
title.txPr.setBodyPr(new CBodyPr());
title.txPr.bodyPr.setVert(nVertTTvert);
var line_chart = plot_area.chart;
var line_chart = plot_area.charts[0];
line_chart.setGrouping(type);
line_chart.setVaryColors(false);
line_chart.setDLbls(new CDLbls());
......@@ -2110,7 +2110,6 @@ function CreateLineChart(asc_chart, type)
function CreateBarChart(asc_chart, type)
{
var asc_series = asc_chart.series;
var chart_space = new CChartSpace();
chart_space.setDate1904(false);
......@@ -2127,10 +2126,10 @@ function CreateBarChart(asc_chart, type)
chart.setShowDLblsOverMax(false);
var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout());
plot_area.setChart(new CBarChart());
plot_area.addChart(new CBarChart());
plot_area.addAxis(new CCatAx());
plot_area.addAxis(new CValAx());
var bar_chart = plot_area.chart;
var bar_chart = plot_area.charts[0];
bar_chart.setBarDir(BAR_DIR_COL);
bar_chart.setGrouping(type);
bar_chart.setVaryColors(false);
......@@ -2279,10 +2278,10 @@ function CreateHBarChart(asc_chart, type)
chart.setShowDLblsOverMax(false);
var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout());
plot_area.setChart(new CBarChart());
plot_area.addChart(new CBarChart());
plot_area.addAxis(new CCatAx());
plot_area.addAxis(new CValAx());
var bar_chart = plot_area.chart;
var bar_chart = plot_area.charts[0];
bar_chart.setBarDir(BAR_DIR_BAR);
bar_chart.setGrouping(type);
bar_chart.setVaryColors(false);
......@@ -2375,7 +2374,7 @@ function CreateHBarChart(asc_chart, type)
var val_ax = plot_area.valAx;
val_ax.setScaling(new CScaling());
val_ax.setDelete(false);
val_ax.setAxPos(AX_POS_L);
val_ax.setAxPos(AX_POS_B);
val_ax.setMajorGridlines(new CSpPr());
val_ax.setNumFmt(new CNumFmt());
val_ax.setMajorTickMark(TICK_MARK_OUT);
......@@ -2434,10 +2433,10 @@ function CreateAreaChart(asc_chart, type)
chart.setShowDLblsOverMax(false);
var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout());
plot_area.setChart(new CAreaChart());
plot_area.addChart(new CAreaChart());
plot_area.addAxis(new CCatAx());
plot_area.addAxis(new CValAx());
var area_chart = plot_area.chart;
var area_chart = plot_area.charts[0];
area_chart.setGrouping(GROUPING_STANDARD);
area_chart.setVaryColors(false);
var parsedHeaders = asc_chart.parseSeriesHeaders();
......@@ -2581,11 +2580,9 @@ function CreatePieChart(asc_chart, type)
chart.setPlotArea(new CPlotArea());
var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout());
plot_area.setChart(new CPieChart());
var pie_chart = plot_area.chart;
plot_area.addChart(new CPieChart());
var pie_chart = plot_area.charts[0];
pie_chart.setVaryColors(true);
plot_area.addAxis(new CCatAx());
plot_area.addAxis(new CValAx());
var parsedHeaders = asc_chart.parseSeriesHeaders();
for(var i = 0; i < asc_series.length; ++i)
{
......@@ -2692,15 +2689,14 @@ function CreateScatterChart(asc_chart)
chart.setPlotArea(new CPlotArea());
var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout());
plot_area.setChart(new CScatterChart());
var scatter_chart = plot_area.chart;
plot_area.addChart(new CScatterChart());
var scatter_chart = plot_area.charts[0];
scatter_chart.setScatterStyle(SCATTER_STYLE_LINE_MARKER);
scatter_chart.setVaryColors(false);
plot_area.addAxis(new CValAx());
plot_area.addAxis(new CValAx());
plot_area.catAx = plot_area.axis[0];
plot_area.valAx = plot_area.axis[1];
plot_area.catAx = plot_area.axId[0];
plot_area.valAx = plot_area.axId[1];
var first_series = asc_series.length > 1 ? asc_series[0] : null;
var start_index = asc_series.length > 1 ? 1 : 0;
var parsedHeaders = asc_chart.parseSeriesHeaders();
......@@ -2857,10 +2853,10 @@ function CreateStockChart(asc_chart)
chart.setShowDLblsOverMax(false);
var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout());
plot_area.setChart(new CStockChart());
plot_area.addChart(new CStockChart());
plot_area.addAxis(new CCatAx());
plot_area.addAxis(new CValAx());
var line_chart = plot_area.chart;
var line_chart = plot_area.charts[0];
line_chart.setDLbls(new CDLbls());
line_chart.addAxId(plot_area.catAx);
line_chart.addAxId(plot_area.valAx);
......@@ -2988,4 +2984,80 @@ function CreateStockChart(asc_chart)
page_margins.setHeader(0.3);
page_margins.setFooter(0.3);
return chart_space;
}
function CreateDefaultAxises(valFormatCode)
{
var cat_ax = new CCatAx();
cat_ax.setScaling(new CScaling());
cat_ax.setDelete(false);
cat_ax.setAxPos(AX_POS_B);
cat_ax.setMajorTickMark(TICK_MARK_OUT);
cat_ax.setMinorTickMark(TICK_MARK_NONE);
cat_ax.setCrosses(CROSSES_AUTO_ZERO);
cat_ax.setAuto(true);
cat_ax.setLblAlgn(LBL_ALG_CTR);
cat_ax.setLblOffset(100);
cat_ax.setNoMultiLvlLbl(false);
var scaling = cat_ax.scaling;
scaling.setOrientation(ORIENTATION_MIN_MAX);
var val_ax = new CValAx();
val_ax.setScaling(new CScaling());
val_ax.setDelete(false);
val_ax.setAxPos(AX_POS_L);
val_ax.setMajorGridlines(new CSpPr());
val_ax.setNumFmt(new CNumFmt());
var num_fmt = val_ax.numFmt;
num_fmt.setFormatCode(valFormatCode);
num_fmt.setSourceLinked(true);
val_ax.setMajorTickMark(TICK_MARK_OUT);
val_ax.setMinorTickMark(TICK_MARK_NONE);
val_ax.setTickLblPos(TICK_LABEL_POSITION_NEXT_TO);
val_ax.setCrossAx(cat_ax);
val_ax.setCrosses(CROSSES_AUTO_ZERO);
val_ax.setCrossBetween(CROSS_BETWEEN_BETWEEN);
scaling = val_ax.scaling;
scaling.setOrientation(ORIENTATION_MIN_MAX);
cat_ax.setCrossAx(val_ax);
cat_ax.setTitle(new CTitle());
val_ax.setTitle(new CTitle());
var title = val_ax.title;
title.setTxPr(new CTextBody());
title.txPr.setBodyPr(new CBodyPr());
title.txPr.bodyPr.setVert(nVertTTvert);
return {valAx: val_ax, catAx: cat_ax};
}
function CreateScatterAxis()
{
var cat_ax = new CValAx();
var val_ax = new CValAx();
cat_ax.setScaling(new CScaling());
cat_ax.setDelete(false);
cat_ax.setAxPos(AX_POS_B);
cat_ax.setMajorTickMark(TICK_MARK_OUT);
cat_ax.setMinorTickMark(TICK_MARK_NONE);
cat_ax.setTickLblPos(TICK_LABEL_POSITION_NEXT_TO);
cat_ax.setCrossAx(val_ax);
cat_ax.setCrosses(CROSSES_AUTO_ZERO);
cat_ax.scaling.setOrientation(ORIENTATION_MIN_MAX);
val_ax.setScaling(new CScaling());
val_ax.setDelete(false);
val_ax.setAxPos(AX_POS_L);
val_ax.setMajorGridlines(new CSpPr());
val_ax.setNumFmt(new CNumFmt());
val_ax.setMajorTickMark(TICK_MARK_OUT);
val_ax.setMinorTickMark(TICK_MARK_NONE);
val_ax.setTickLblPos(TICK_LABEL_POSITION_NEXT_TO);
val_ax.setCrossAx(val_ax);
val_ax.setCrosses(CROSSES_AUTO_ZERO);
val_ax.setCrossBetween(CROSS_BETWEEN_BETWEEN);
var scaling = val_ax.scaling;
scaling.setOrientation(ORIENTATION_MIN_MAX);
var num_fmt = val_ax.numFmt;
var format_code = "General";
num_fmt.setFormatCode(format_code);
num_fmt.setSourceLinked(true);
return {valAx: val_ax, catAx: cat_ax};
}
\ No newline at end of file
......@@ -133,7 +133,7 @@ var historyitem_DLbl_SetTxPr = 2129;
var historyitem_Marker_SetSize = 2130;
var historyitem_Marker_SetSpPr = 2131;
var historyitem_Marker_SetSymbol = 2132;
var historyitem_PlotArea_SetChart = 2133;
var historyitem_PlotArea_AddChart = 2133;
var historyitem_PlotArea_SetCatAx = 2134;
var historyitem_PlotArea_SetDateAx = 2135;
var historyitem_PlotArea_SetDTable = 2136;
......@@ -142,6 +142,8 @@ var historyitem_PlotArea_SetSerAx = 2138;
var historyitem_PlotArea_SetSpPr = 2139;
var historyitem_PlotArea_SetValAx = 2140;
var historyitem_PlotArea_AddAxis = 2141;
var historyitem_PlotArea_RemoveChart = 2142;
var historyitem_PlotArea_RemoveAxis = 2143;
var historyitem_Axis_SetType = 2141;
var historyitem_Axis_SetAuto = 2142;
var historyitem_Axis_SetAxId = 2143;
......
......@@ -43,9 +43,6 @@ function isRealBool(b)
}
function writeLong(w, val)
{
w.WriteBool(isRealNumber(val));
......@@ -3432,7 +3429,7 @@ CUniFill.prototype =
Set_FromObject: function(o)
{
//TODO
//TODO:
},
Undo: function(data)
......@@ -8797,7 +8794,7 @@ CBgPr.prototype =
return this.Id;
},
getObjecType: function()
getObjectType: function()
{
return historyitem_type_BgPr;
},
......
......@@ -202,6 +202,7 @@
this.horAx = null;
this.horGridLines = null;
this.vertGridLines = null;
this.type = null;
}
asc_ChartSettings.prototype =
{
......@@ -303,6 +304,16 @@
getVertGridLines: function()
{
return this.vertGridLines;
},
getType: function()
{
return this.type;
},
putType: function(v)
{
return this.type = v;
}
};
......@@ -329,6 +340,8 @@
prot["putHorGridLines"] = prot.putHorGridLines;
prot["getVertGridLines"] = prot.getVertGridLines;
prot["putVertGridLines"] = prot.putVertGridLines;
prot["getType"] = prot.getType;
prot["putType"] = prot.putType;
window["asc_ChartSettings"] = asc_ChartSettings;
function asc_AxisSettings()
......
......@@ -165,4 +165,28 @@ var c_oAscGridLinesSettings =
major: 1,
minor: 2,
majorMinor: 3
};
var c_oAscChartTypeSettings =
{
barNormal : 0,
barStacked : 1,
barStackedPer : 2,
lineNormal : 3,
lineStacked : 4,
lineStackedPer : 5,
lineNormalMarker : 6,
lineStackedMarker : 7,
lineStackedPerMarker: 8,
pie : 9,
hBarNormal : 10,
hBarStacked : 11,
hBarStackedPer : 12,
areaNormal : 13,
areaStacked : 14,
areaStackedPer : 15,
scatter : 16,
scatterLine : 17,
scatterSmooth : 18
};
\ No newline at end of file
......@@ -2298,7 +2298,32 @@ Format
</div>
<div id="rightPanelChartPropsDiv" class="right_panel_drawing_props">
<div><p style="font-size: 14pt">Design</p></div>
<button id="chageChartTypeButton">Change Type</button>
<!--<button id="chageChartTypeButton">Change Type</button> -->
<select id="changeChartTypeSelect">
<option value="barNormal" style="background: #7F9DB9">Bar Normal</option>
<option value="barStacked">Bar Stacked</option>
<option value="barStackedPer">Bar Stacked Per</option>
<option value="lineNormal" style="background: #7F9DB9">Line Normal</option>
<option value="lineStacked">Line Stacked</option>
<option value="lineStackedPer">Line Stacked Per</option>
<option value="lineNormalMarker">Line Normal Marker</option>
<option value="lineStackedMarker">Line Stacked Marker</option>
<option value="lineStackedPerMarker">Line Stacked Per Marker</option>
<option value="pie" style="background: #7F9DB9">Pie</option>
<option value="hBarNormal" style="background: #7F9DB9">HBar Normal</option>
<option value="hBarStacked">HBar Stacked</option>
<option value="hBarStackedPer">HBar Stacked Per</option>
<option value="areaNormal" style="background: #7F9DB9">Area Normal</option>
<option value="areaStacked">Area Stacked</option>
<option value="areaStackedPer">Area Stacked Per</option>
<option value="scatter" style="background: #7F9DB9">Scatter</option>
<option value="scatter">Scatter Line</option>
</select>
<button id="rowColsButton">Rows/Cols</button>
<button id="selectDataButton">Select Data</button>
<br>
......@@ -2386,6 +2411,55 @@ Format
</div>
</div>
<div id="changeChartTypeDiv" style="background: #ece9d8; z-index:500; width: 619px; height: 515px; position: absolute; left:100px; top:100px; font-family: Tahoma; display: none">
<div id="leftPanelChartType" style="position:absolute; left: 7px; top: 7px; height: 470px; width: 150px; background: #ffffff;border: 1px solid rgb(127,157,185)">
<div class="leftPanelCharPropsItemDiv" id="barTypeLeftPanel">
<p>Bar</p>
</div>
<div class="leftPanelCharPropsItemDiv" id="lineTypeLeftPanel">
<p>Line</p>
</div>
<div class="leftPanelCharPropsItemDiv" id="pieTypeLeftPanel">
<p>Pie</p>
</div>
<div class="leftPanelCharPropsItemDiv" id="hBarTypeLeftPanel">
<p>HBar</p>
</div>
<div class="leftPanelCharPropsItemDiv" id="areaTypeLeftPanel">
<p>Area</p>
</div>
<div class="leftPanelCharPropsItemDiv" id="scatterTypeLeftPanel">
<p>Scatter</p>
</div>
<div class="leftPanelCharPropsItemDiv" id="stockTypeLeftPanel">
<p>Stock</p>
</div>
</div>
<div class="right_panel_drawing_props" id="barTypeRightPanel" style="display: none">
</div>
<div class="right_panel_drawing_props" id="lineTypeRightPanel" style="display: none">
<p>Line</p>
</div>
<div class="right_panel_drawing_props" id="pieTypeRightPanel" style="display: none">
<p>Pie</p>
</div>
<div class="right_panel_drawing_props" id="hBarTypeRightPanel" style="display: none">
<p>HBar</p>
</div>
<div class="right_panel_drawing_props" id="areaTypeRightPanel" style="display: none">
<p>Area</p>
</div>
<div class="right_panel_drawing_props" id="scatterTypeRightPanel" style="display: none">
<p>Scatter</p>
</div>
<div class="right_panel_drawing_props" id="stockTypeRightPanel" style="display: none">
<p>Stock</p>
</div>
</div>
<div id="vertAxisMenuDiv" style="display: none;background: #ece9d8; z-index: 8000; width: 619px; height: 515px; position: absolute; left: 0px; top:0px">
<div id="leftPanelDiv">
<div class="leftPanelItem" id="vertAxisOptionsDiv">
......
......@@ -2900,5 +2900,35 @@
}
);
$("#changeChartTypeSelect").change(function()
{
var val = $("#changeChartTypeSelect").attr("value");
var map =
{
"barNormal" : c_oAscChartTypeSettings.barNormal ,
"barStacked" : c_oAscChartTypeSettings.barStacked ,
"barStackedPer" : c_oAscChartTypeSettings.barStackedPer ,
"lineNormal" : c_oAscChartTypeSettings.lineNormal ,
"lineStacked" : c_oAscChartTypeSettings.lineStacked ,
"lineStackedPer" : c_oAscChartTypeSettings.lineStackedPer ,
"lineNormalMarker" : c_oAscChartTypeSettings.lineNormalMarker ,
"lineStackedMarker" : c_oAscChartTypeSettings.lineStackedMarker ,
"lineStackedPerMarker": c_oAscChartTypeSettings.lineStackedPerMarker,
"pie" : c_oAscChartTypeSettings.pie ,
"hBarNormal" : c_oAscChartTypeSettings.hBarNormal ,
"hBarStacked" : c_oAscChartTypeSettings.hBarStacked ,
"hBarStackedPer" : c_oAscChartTypeSettings.hBarStackedPer ,
"areaNormal" : c_oAscChartTypeSettings.areaNormal ,
"areaStacked" : c_oAscChartTypeSettings.areaStacked ,
"areaStackedPer" : c_oAscChartTypeSettings.areaStackedPer ,
"scatter" : c_oAscChartTypeSettings.scatter
};
var settings = new asc_ChartSettings();
settings.putType(map[val]);
api.asc_editChartDrawingObject(settings);
});
});
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