Commit ffec1835 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@54887 954022d7-b5bf-4e40-9824-e11837661b57
parent 9b485a6e
......@@ -1453,7 +1453,6 @@ DrawingObjectsController.prototype =
{
if(isRealNumber(DLBL_POS_DEFINES_MAP[data_labels_pos_setting]))
{
if(!chart_type.dLbls)
{
var d_lbls = new CDLbls();
......@@ -1471,7 +1470,6 @@ DrawingObjectsController.prototype =
//TODO
var i;
var type = chartSettings.getType();
var need_groupping, need_num_fmt, need_bar_dir;
var val_axis, new_chart_type, object_type, axis_obj ;
var axis_by_types;
......@@ -1732,7 +1730,6 @@ DrawingObjectsController.prototype =
//подписи данных
if(typeof chart_type.setDLbls === "function")
{
var data_lbls;
var checkDataLabels = function(chartType)
{
......@@ -1852,6 +1849,10 @@ DrawingObjectsController.prototype =
{
return CreateStockChart(chart);
}
case "Radar":
{
return CreateRadarChart(chart);
}
}
return null;
},
......
......@@ -11777,7 +11777,7 @@ CPivotFmt.prototype =
function CRadarChart()
{
this.axId = null;
this.axId = [];
this.dLbls = null;
this.radarStyle = null;
this.series = [];
......@@ -11798,15 +11798,14 @@ CRadarChart.prototype =
return historyitem_type_RadarChart;
},
removeDataLabels: CBarChart.prototype.removeDataLabels,
getAxisByTypes: CPlotArea.prototype.getAxisByTypes,
setAxId: function(pr)
addAxId: function(pr)
{
History.Add(this, {Type: historyitem_RadarChart_SetAxId, oldPr: this.axId, newPr:pr});
this.axId = pr;
History.Add(this, {Type: historyitem_RadarChart_AddAxId, newPr:pr});
this.axId.push(pr);
},
setDLbls: function(pr)
......@@ -11837,9 +11836,16 @@ CRadarChart.prototype =
{
switch(data.Type)
{
case historyitem_RadarChart_SetAxId:
case historyitem_RadarChart_AddAxId:
{
this.axId = data.oldPr;
for(var i = this.axId.length - 1; i > -1; --i)
{
if(this.axId[i] === data.newPr)
{
this.axId.splice(i, 1);
break;
}
}
break;
}
case historyitem_RadarChart_SetDLbls:
......@@ -11870,15 +11876,15 @@ CRadarChart.prototype =
break;
}
}
} ,
},
Redo: function(data)
{
switch(data.Type)
{
case historyitem_RadarChart_SetAxId:
case historyitem_RadarChart_AddAxId:
{
this.axId = data.newPr;
this.axId.push(data.newPr);
break;
}
case historyitem_RadarChart_SetDLbls:
......@@ -11909,13 +11915,9 @@ CRadarChart.prototype =
w.WriteLong(data.Type);
switch(data.Type)
{
case historyitem_RadarChart_SetAxId:
case historyitem_RadarChart_AddAxId:
{
w.WriteBool(isRealNumber(data.newPr));
if(isRealNumber(data.newPr))
{
w.WriteLong(data.newPr);
}
writeObject(w, data.newPr);
break;
}
case historyitem_RadarChart_SetDLbls:
......@@ -11952,18 +11954,14 @@ CRadarChart.prototype =
Load_Changes: function(r)
{
switch(data.Type)
var type = r.GetLong();
switch(type)
{
case historyitem_RadarChart_SetAxId:
case historyitem_RadarChart_AddAxId:
{
if(r.GetBool())
{
this.axId = r.GetLong();
}
else
{
this.axId = null;
}
var axis = readObject(r);
if(axis)
this.axId.push(axis);
break;
}
case historyitem_RadarChart_SetDLbls:
......@@ -12016,7 +12014,6 @@ CRadarChart.prototype =
}
}
}
};
......
......@@ -3061,4 +3061,145 @@ function CreateScatterAxis()
num_fmt.setFormatCode(format_code);
num_fmt.setSourceLinked(true);
return {valAx: val_ax, catAx: cat_ax};
}
function CreateRadarChart(asc_chart)
{
var asc_series = asc_chart.series;
var chart_space = new CChartSpace();
chart_space.setDate1904(false);
chart_space.setLang("ru-Ru");
chart_space.setRoundedCorners(false);
chart_space.setChart(new CChart());
chart_space.setPrintSettings(new CPrintSettings());
var chart = chart_space.chart;
chart.setAutoTitleDeleted(false);
chart.setPlotArea(new CPlotArea());
chart.setLegend(new CLegend());
chart.setPlotVisOnly(true);
chart.setDispBlanksAs(DISP_BLANKS_AS_GAP);
chart.setShowDLblsOverMax(false);
var plot_area = chart.plotArea;
plot_area.setLayout(new CLayout());
plot_area.addChart(new CRadarChart());
plot_area.addAxis(new CCatAx());
plot_area.addAxis(new CValAx());
var bar_chart = plot_area.charts[0];
bar_chart.setVaryColors(false);
var parsedHeaders = asc_chart.parseSeriesHeaders();
for(var i = 0; i < asc_series.length; ++i)
{
var series = new CBarSeries();
series.setIdx(i);
series.setOrder(i);
series.setInvertIfNegative(false);
series.setVal(new CYVal());
var val = series.val;
val.setNumRef(new CNumRef());
var num_ref = val.numRef;
num_ref.setF(asc_series[i].Val.Formula);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
}
if(parsedHeaders.bTop)
{
series.setCat(new CCat());
var cat = series.cat;
cat.setStrRef(new CStrRef());
var str_ref = cat.strRef;
str_ref.setF(asc_series[i].Cat.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
}
}
if(parsedHeaders.bLeft && asc_series[i].TxCache)
{
series.setTx(new CTx());
var tx= series.tx;
tx.setStrRef(new CStrRef());
var str_ref = tx.strRef;
str_ref.setF(asc_series[i].TxCache.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setVal(asc_series[i].TxCache.Tx);
}
bar_chart.addSer(series);
}
bar_chart.setDLbls(new CDLbls());
bar_chart.addAxId(plot_area.catAx);
bar_chart.addAxId(plot_area.valAx);
var d_lbls = bar_chart.dLbls;
d_lbls.setShowLegendKey(false);
d_lbls.setShowVal(true);
d_lbls.setShowCatName(true);
d_lbls.setShowSerName(true);
d_lbls.setShowPercent(false);
d_lbls.setShowBubbleSize(false);
var cat_ax = plot_area.catAx;
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.setCrossAx(plot_area.valAx);
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 = plot_area.valAx;
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;
var format_code = "General";
num_fmt.setFormatCode(format_code);
num_fmt.setSourceLinked(true);
val_ax.setMajorTickMark(TICK_MARK_CROSS);
val_ax.setMinorTickMark(TICK_MARK_NONE);
val_ax.setTickLblPos(TICK_LABEL_POSITION_NEXT_TO);
val_ax.setCrossAx(plot_area.catAx);
val_ax.setCrosses(CROSSES_AUTO_ZERO);
val_ax.setCrossBetween(CROSS_BETWEEN_BETWEEN);
scaling = val_ax.scaling;
scaling.setOrientation(ORIENTATION_MIN_MAX);
var legend = chart.legend;
legend.setLegendPos(LEGEND_POS_R);
legend.setLayout(new CLayout());
legend.setOverlay(false);
var print_settings = chart_space.printSettings;
print_settings.setHeaderFooter(new CHeaderFooterChart());
print_settings.setPageMargins(new CPageMarginsChart());
print_settings.setPageSetup(new CPageSetup());
var page_margins = print_settings.pageMargins;
page_margins.setB(0.75);
page_margins.setL(0.7);
page_margins.setR(0.7);
page_margins.setT(0.75);
page_margins.setHeader(0.3);
page_margins.setFooter(0.3);
return chart_space;
}
\ No newline at end of file
......@@ -250,7 +250,7 @@ var historyitem_PieChart_SetDLbls = 2243;
var historyitem_PieChart_SetFirstSliceAng = 2244;
var historyitem_PieChart_AddSer = 2245;
var historyitem_PieChart_SetVaryColors = 2246;
var historyitem_RadarChart_SetAxId = 2247;
var historyitem_RadarChart_AddAxId = 2247;
var historyitem_RadarChart_SetDLbls = 2248;
var historyitem_RadarChart_SetRadarStyle = 2249;
var historyitem_RadarChart_AddSer = 2250;
......
......@@ -207,6 +207,8 @@
this.showCatName = null;
this.showVal = null;
this.separator = null;
this.horAxisProps = null;
this.vertAxisProps = null;
}
asc_ChartSettings.prototype =
{
......@@ -355,8 +357,28 @@
getSeparator: function()
{
return this.separator;
}
},
putHorAxisProps: function(v)
{
this.horAxisProps = v;
},
getHorAxisProps: function()
{
return this.horAxisProps;
},
putVertAxisProps: function(v)
{
this.vertAxisProps = v;
},
getVertAxisProps: function()
{
return this.vertAxisProps;
}
};
prot = asc_ChartSettings.prototype;
......@@ -392,46 +414,300 @@
prot["getShowVal"] = prot.getShowVal;
prot["putSeparator"] = prot.putSeparator;
prot["getSeparator"] = prot.getSeparator;
prot["putHorAxisProps"] = prot.putHorAxisProps;
prot["getHorAxisProps"] = prot.getHorAxisProps;
prot["putVertAxisProps"] = prot.putVertAxisProps;
prot["getVertAxisProps"] = prot.getVertAxisProps;
window["asc_ChartSettings"] = asc_ChartSettings;
function asc_AxisSettings()
function asc_ValAxisSettings()
{
this.type = null;
this.settings = null;
this.minValRule = null;
this.minVal = null;
this.maxValRule = null;
this.maxVal = null;
this.invertValOrder = null;
this.logScale = null;
this.logBase = null;
this.units = null;
this.showUnitsOnChart = null;
this.majorTickMark = null;
this.minorTickMark = null;
this.tickLabelsPos = null;
this.crossesRule = null;
this.crosses = null;
}
asc_AxisSettings.prototype =
asc_ValAxisSettings.prototype =
{
putType: function(val)
putMinValRule: function(v)
{
this.type = val;
this.minValRule = v;
},
putSettings: function(val)
putMinVal: function(v)
{
this.settings = val;
this.minVal = v;
},
getType: function()
putMaxValRule: function(v)
{
return this.type;
this.maxValRule = v;
},
putMaxVal: function(v)
{
this.maxVal = v;
},
putInvertValOrder: function(v)
{
this.invertValOrder = v;
},
putLogScale: function(v)
{
this.logScale = v;
},
putLogBase: function(v)
{
this.logBase = v;
},
putUnits: function(v)
{
this.units = v;
},
putShowUnitsOnChart: function(v)
{
this.showUnitsOnChart = v;
},
putMajorTickMark: function(v)
{
this.majorTickMark = v;
},
putMinorTickMark: function(v)
{
this.minorTickMark = v;
},
putTickLabelsPos: function(v)
{
this.tickLabelsPos = v;
},
putCrossesRule: function(v)
{
this.crossesRule = v;
},
putCrosses: function(v)
{
this.crosses = v;
},
getSettings: function()
getMinValRule: function()
{
return this.minValRule;
},
getMinVal: function()
{
return this.settings;
return this.minVal;
},
getMaxValRule: function()
{
return this.maxValRule;
},
getMaxVal: function()
{
return this.maxVal;
},
getInvertValOrder: function()
{
return this.invertValOrder;
},
getLogScale: function()
{
return this.logScale;
},
getLogBase: function()
{
return this.logBase;
},
getUnits: function()
{
return this.units;
},
getShowUnitsOnChart: function()
{
return this.showUnitsOnChart;
},
getMajorTickMark: function()
{
return this.majorTickMark;
},
getMinorTickMark: function()
{
return this.minorTickMark;
},
getTickLabelsPos: function()
{
return this.tickLabelPos;
},
getCrossesRule: function()
{
return this.crossesRule;
},
getCrosses: function()
{
return this.crosses;
}
};
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;
prot = asc_ValAxisSettings.prototype;
prot["putMinValRule"] = prot.putMinValRule ;
prot["putMinVal"] = prot.putMinVal ;
prot["putMaxValRule"] = prot.putMaxValRule ;
prot["putMaxVal"] = prot.putMaxVal ;
prot["putInvertValOrder"] = prot.putInvertValOrder ;
prot["putLogScale"] = prot.putLogScale ;
prot["putLogBase"] = prot.putLogBase ;
prot["putUnits"] = prot.putUnits ;
prot["putShowUnitsOnChart"] = prot.putShowUnitsOnChart ;
prot["putMajorTickMark"] = prot.putMajorTickMark ;
prot["putMinorTickMark"] = prot.putMinorTickMark ;
prot["putTickLabelsPos"] = prot.putTickLabelsPos ;
prot["putCrossesRule"] = prot.putCrossesRule ;
prot["putCrosses"] = prot.putCrosses ;
prot["getMinValRule"] = prot.getMinValRule ;
prot["getMinVal"] = prot.getMinVal ;
prot["getMaxValRule"] = prot.getMaxValRule ;
prot["getMaxVal"] = prot.getMaxVal ;
prot["getInvertValOrder"] = prot.getInvertValOrder ;
prot["getLogScale"] = prot.getLogScale ;
prot["getLogBase"] = prot.getLogBase ;
prot["getUnits"] = prot.getUnits ;
prot["getShowUnitsOnChart"] = prot.getShowUnitsOnChart ;
prot["getMajorTickMark"] = prot.getMajorTickMark ;
prot["getMinorTickMark"] = prot.getMinorTickMark ;
prot["getTickLabelsPos"] = prot.getTickLabelsPos ;
prot["getCrossesRule"] = prot.getCrossesRule ;
prot["getCrosses"] = prot.getCrosses ;
function asc_CatAxisSettings()
{
this.intervalBetweenLabelsRule = null;
this.intervalBetweenLabels = null;
this.invertCatOrder = null;
this.labelsAxisDistance = null;
this.majorTickMark = null;
this.minorTickMark = null;
this.tickLabelsPos = null;
this.crossesRule = null;
this.crosses = null;
}
asc_CatAxisSettings.prototype =
{
putIntervalBetweenLabelsRule: function(v)
{
this.intervalBetweenLabelsRule = v;
},
putIntervalBetweenLabels: function(v)
{
this.intervalBetweenLabels = v;
},
putInvertCatOrder: function(v)
{
this.invertCatOrder = v;
},
putLabelsAxisDistance: function(v)
{
this.labelsAxisDistance = v;
},
putMajorTickMark: function(v)
{
this.majorTickMark = v;
},
putMinorTickMark: function(v)
{
this.minorTickMark = v;
},
putTickLabelsPos: function(v)
{
this.tickLabelsPos = v;
},
putCrossesRule: function(v)
{
this.crossesRule = v;
},
putCrosses: function(v)
{
this.crosses = v;
},
getIntervalBetweenLabelsRule: function()
{
return this.intervalBetweenLabelsRule ;
},
getIntervalBetweenLabels: function()
{
return this.intervalBetweenLabels ;
},
getInvertCatOrder: function()
{
return this.invertCatOrder ;
},
getLabelsAxisDistance: function()
{
return this.labelsAxisDistance ;
},
getMajorTickMark: function()
{
return this.majorTickMark ;
},
getMinorTickMark: function()
{
return this.minorTickMark ;
},
getTickLabelsPos: function()
{
return this.tickLabelsPos;
},
getCrossesRule: function()
{
return this.crossesRule ;
},
getCrosses: function()
{
return this.crosses;
}
};
prot = asc_CatAxisSettings.prototype;
prot["putIntervalBetweenLabelsRule"] = prot.putIntervalBetweenLabelsRule;
prot["putIntervalBetweenLabels"] = prot.putIntervalBetweenLabels ;
prot["putInvertCatOrder"] = prot.putInvertCatOrder ;
prot["putLabelsAxisDistance"] = prot.putLabelsAxisDistance ;
prot["putMajorTickMark"] = prot.putMajorTickMark ;
prot["putMinorTickMark"] = prot.putMinorTickMark ;
prot["putTickLabelsPos"] = prot.putTickLablesPos ;
prot["putCrossesRule"] = prot.putCrossesRule ;
prot["putCrosses"] = prot.putCrosses ;
prot["getIntervalBetweenLabelsRule"] = prot.getIntervalBetweenLabelsRule;
prot["getIntervalBetweenLabels"] = prot.getIntervalBetweenLabels ;
prot["getInvertCatOrder"] = prot.getInvertCatOrder ;
prot["getLabelsAxisDistance"] = prot.getLabelsAxisDistance ;
prot["getMajorTickMark"] = prot.getMajorTickMark ;
prot["getMinorTickMark"] = prot.getMinorTickMark ;
prot["getTickLabelsPos"] = prot.getTickLablesPos ;
prot["getCrossesRule"] = prot.getCrossesRule ;
prot["getCrosses"] = prot.getCrosses ;
}
)(window);
var CColor = window["CColor"];
var asc_ChartSettings = window["asc_ChartSettings"];
var asc_AxisSettings = window["asc_AxisSettings"];
\ No newline at end of file
var asc_AxisSettings = window["asc_AxisSettings"];
var asc_ValAxisSettings = window["asc_ValAxisSettings"];
\ No newline at end of file
......@@ -190,4 +190,59 @@ var c_oAscChartTypeSettings =
scatterLine : 17,
scatterSmooth : 18,
doughnut : 19
};
var c_oAscValAxisRule =
{
auto:0,
fixed:1
};
var c_oAscValAxUnits =
{
none:0,
BILLIONS: 1,
HUNDRED_MILLIONS: 2,
HUNDREDS: 3,
HUNDRED_THOUSANDS: 4,
MILLIONS: 5,
TEN_MILLIONS: 6,
TEN_THOUSANDS: 7,
TRILLIONS: 8
};
var c_oAscTickMark =
{
TICK_MARK_CROSS: 0,
TICK_MARK_IN: 1,
TICK_MARK_NONE: 2,
TICK_MARK_OUT: 3
};
var c_oAscTickLabelsPos =
{
TICK_LABEL_POSITION_HIGH:0,
TICK_LABEL_POSITION_LOW: 1,
TICK_LABEL_POSITION_NEXT_TO: 2,
TICK_LABEL_POSITION_NONE : 3
};
var c_oAscCrossesRule =
{
auto:0,
maxValue: 1,
value: 2
};
var c_oAscHorAxisType =
{
auto: 0,
date: 1,
text: 2
};
var c_oAscBetweenLabelsRule =
{
auto: 0,
manual: 1
};
\ 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