Commit 73f3215f authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

настройки для подписей данных и легенда для Pie и Doughnut

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@54852 954022d7-b5bf-4e40-9824-e11837661b57
parent 2ba532bb
This diff is collapsed.
This diff is collapsed.
...@@ -203,6 +203,10 @@ ...@@ -203,6 +203,10 @@
this.horGridLines = null; this.horGridLines = null;
this.vertGridLines = null; this.vertGridLines = null;
this.type = null; this.type = null;
this.showSerName = null;
this.showCatName = null;
this.showVal = null;
this.separator = null;
} }
asc_ChartSettings.prototype = asc_ChartSettings.prototype =
{ {
...@@ -314,7 +318,45 @@ ...@@ -314,7 +318,45 @@
putType: function(v) putType: function(v)
{ {
return this.type = v; return this.type = v;
},
putShowSerName: function(v)
{
return this.showSerName = v;
},
putShowCatName: function(v)
{
return this.showCatName = v;
},
putShowVal: function(v)
{
return this.showVal = v;
},
getShowSerName: function()
{
return this.showSerName;
},
getShowCatName: function()
{
return this.showCatName;
},
getShowVal: function()
{
return this.showVal;
},
putSeparator: function(v)
{
this.separator = v;
},
getSeparator: function()
{
return this.separator;
} }
}; };
prot = asc_ChartSettings.prototype; prot = asc_ChartSettings.prototype;
...@@ -336,12 +378,21 @@ ...@@ -336,12 +378,21 @@
prot["getDataLabelsPos"] = prot.getDataLabelsPos; prot["getDataLabelsPos"] = prot.getDataLabelsPos;
prot["getHorAx"] = prot.getHorAx; prot["getHorAx"] = prot.getHorAx;
prot["getVertAx"] = prot.getVertAx; prot["getVertAx"] = prot.getVertAx;
prot["getHorGridLines"] = prot.getHorGridLines; prot["getHorGridLines"] = prot.getHorGridLines;
prot["putHorGridLines"] = prot.putHorGridLines; prot["putHorGridLines"] = prot.putHorGridLines;
prot["getVertGridLines"] = prot.getVertGridLines; prot["getVertGridLines"] = prot.getVertGridLines;
prot["putVertGridLines"] = prot.putVertGridLines; prot["putVertGridLines"] = prot.putVertGridLines;
prot["getType"] = prot.getType; prot["getType"] = prot.getType;
prot["putType"] = prot.putType; prot["putType"] = prot.putType;
prot["putShowSerName"] = prot.putShowSerName;
prot["getShowSerName"] = prot.getShowSerName;
prot["putShowCatName"] = prot.putShowCatName;
prot["getShowCatName"] = prot.getShowCatName;
prot["putShowVal"] = prot.putShowVal;
prot["getShowVal"] = prot.getShowVal;
prot["putSeparator"] = prot.putSeparator;
prot["getSeparator"] = prot.getSeparator;
window["asc_ChartSettings"] = asc_ChartSettings; window["asc_ChartSettings"] = asc_ChartSettings;
function asc_AxisSettings() function asc_AxisSettings()
......
...@@ -188,5 +188,6 @@ var c_oAscChartTypeSettings = ...@@ -188,5 +188,6 @@ var c_oAscChartTypeSettings =
areaStackedPer : 15, areaStackedPer : 15,
scatter : 16, scatter : 16,
scatterLine : 17, scatterLine : 17,
scatterSmooth : 18 scatterSmooth : 18,
doughnut : 19
}; };
\ No newline at end of file
...@@ -2313,6 +2313,7 @@ Format ...@@ -2313,6 +2313,7 @@ Format
<option value="lineStackedPerMarker">Line Stacked Per Marker</option> <option value="lineStackedPerMarker">Line Stacked Per Marker</option>
<option value="pie" style="background: #7F9DB9">Pie</option> <option value="pie" style="background: #7F9DB9">Pie</option>
<option value="doughnut" style="background: #7F9DB9">Doughnut</option>
<option value="hBarNormal" style="background: #7F9DB9">HBar Normal</option> <option value="hBarNormal" style="background: #7F9DB9">HBar Normal</option>
<option value="hBarStacked">HBar Stacked</option> <option value="hBarStacked">HBar Stacked</option>
...@@ -2365,15 +2366,23 @@ Format ...@@ -2365,15 +2366,23 @@ Format
</select> </select>
<br> <br>
<label style="font-size: 11pt">Data Labels</label> <label style="font-size: 11pt">Data Labels</label>
<select id="chartDataLabels"> <br>
<option value="none">None</option> <select id="chartDataLabels">
<option value="center">Center</option> <option value="none">None</option>
<option value="inner_top">Inner Top</option> <option value="center">Center</option>
<option value="in_base">In Base</option> <option value="inner_top">Inner Top</option>
<option value="out_end">Out End</option> <option value="in_base">In Base</option>
<option value="right_overlay">Right Overlay</option> <option value="out_end">Out End</option>
<option value="left_overlay">Left Overlay</option> <option value="right_overlay">Right Overlay</option>
</select> <option value="left_overlay">Left Overlay</option>
</select>
<div id="labelsOptionsDiv">
<input type="checkbox" class="dataLabelsCheckBox" value="serName"><label style="font-size: 10pt">Series Name</label>
<br><input type="checkbox" class="dataLabelsCheckBox" value="catName"><label style="font-size: 10pt">Cat Name</label>
<br><input type="checkbox" class="dataLabelsCheckBox" value="val"><label style="font-size: 10pt">Value</label>
</div>
<label style="font-size: 10pt">Data Labels Separator</label><input type="text" id="dataLabelsSeparatorInput">
<br><button id="dataLblsPrApplyButton">Apply</button>
<br> <br>
<label style="font-size: 11pt">Hor Axis</label> <label style="font-size: 11pt">Hor Axis</label>
<select id="chartHorAxis"> <select id="chartHorAxis">
......
...@@ -2854,17 +2854,7 @@ ...@@ -2854,17 +2854,7 @@
$("#chartDataLabels").change( $("#chartDataLabels").change(
function() function()
{ {
var val = $("#chartDataLabels").attr("value");
var map = {
"none" : c_oAscChartDataLabelsPos.none,
"center" : c_oAscChartDataLabelsPos.ctr,
"inner_top" : c_oAscChartDataLabelsPos.inEnd,
"in_base" : c_oAscChartDataLabelsPos.inBase,
"out_end" : c_oAscChartDataLabelsPos.outEnd
};
var settings = new asc_ChartSettings();
settings.putDataLabelsPos(map[val]);
api.asc_editChartDrawingObject(settings);
} }
); );
...@@ -2921,7 +2911,8 @@ ...@@ -2921,7 +2911,8 @@
"areaNormal" : c_oAscChartTypeSettings.areaNormal , "areaNormal" : c_oAscChartTypeSettings.areaNormal ,
"areaStacked" : c_oAscChartTypeSettings.areaStacked , "areaStacked" : c_oAscChartTypeSettings.areaStacked ,
"areaStackedPer" : c_oAscChartTypeSettings.areaStackedPer , "areaStackedPer" : c_oAscChartTypeSettings.areaStackedPer ,
"scatter" : c_oAscChartTypeSettings.scatter "scatter" : c_oAscChartTypeSettings.scatter,
"doughnut" : c_oAscChartTypeSettings.doughnut
}; };
var settings = new asc_ChartSettings(); var settings = new asc_ChartSettings();
...@@ -2929,6 +2920,49 @@ ...@@ -2929,6 +2920,49 @@
api.asc_editChartDrawingObject(settings); api.asc_editChartDrawingObject(settings);
}); });
$(".dataLabelsCheckBox").change(function()
{
// var value = $(this).attr("value");
// var settings = new asc_ChartSettings();
// if(value === "catName")
// settings.putShowCatName(this.checked);
// else if(value === "serName")
// settings.putShowSerName(this.checked);
// else
// settings.putShowVal(this.checked);
//
// api.asc_editChartDrawingObject(settings);
});
$("#dataLblsPrApplyButton").click(
function()
{
var val = $("#chartDataLabels").attr("value");
var map = {
"none" : c_oAscChartDataLabelsPos.none,
"center" : c_oAscChartDataLabelsPos.ctr,
"inner_top" : c_oAscChartDataLabelsPos.inEnd,
"in_base" : c_oAscChartDataLabelsPos.inBase,
"out_end" : c_oAscChartDataLabelsPos.outEnd
};
var settings = new asc_ChartSettings();
settings.putDataLabelsPos(map[val]);
var check_boxes = $(".dataLabelsCheckBox");
var i;
for(i = 0; i < check_boxes.length; ++i)
{
var value = check_boxes[i].value;
if(value === "catName")
settings.putShowCatName(check_boxes[i].checked);
else if(value === "serName")
settings.putShowSerName(check_boxes[i].checked);
else
settings.putShowVal(check_boxes[i].checked);
}
var separator = $("#dataLabelsSeparatorInput").attr("value");
if(separator.length > 0)
settings.putSeparator(separator);
api.asc_editChartDrawingObject(settings);
}
);
}); });
...@@ -658,7 +658,7 @@ CChartSpace.prototype.recalculateMarkers = function() ...@@ -658,7 +658,7 @@ CChartSpace.prototype.recalculateMarkers = function()
default_marker.spPr.ln.merge(parent_objects.theme.themeElements.fmtScheme.lnStyleLst[0]); default_marker.spPr.ln.merge(parent_objects.theme.themeElements.fmtScheme.lnStyleLst[0]);
} }
var RGBA = {R:0, G:0, B:0, A: 255}; var RGBA = {R:0, G:0, B:0, A: 255};
if(this.chart.plotArea.chart.varyColors && this.chart.plotArea.chart.series.length === 1) if(this.chart.plotArea.chart.varyColors && (this.chart.plotArea.chart.series.length === 1 || this.chart.plotArea.chart.getObjectType() === historyitem_type_PieChart || this.chart.plotArea.chart.getObjectType() === historyitem_type_DoughnutChart))
{ {
var ser = this.chart.plotArea.chart.series[0], pts; var ser = this.chart.plotArea.chart.series[0], pts;
if(ser.val) if(ser.val)
...@@ -2574,7 +2574,7 @@ CChartSpace.prototype.recalculateLegend = function() ...@@ -2574,7 +2574,7 @@ CChartSpace.prototype.recalculateLegend = function()
var max_width = 0, cur_width, max_font_size = 0, cur_font_size, ser, b_line_series; var max_width = 0, cur_width, max_font_size = 0, cur_font_size, ser, b_line_series;
var max_word_width = 0; var max_word_width = 0;
this.chart.legend.chart = this; this.chart.legend.chart = this;
if( !this.chart.plotArea.chart.varyColors || (this.chart.plotArea.chart.getObjectType() !== historyitem_type_PieChart || this.chart.plotArea.chart.getObjectType() !== historyitem_type_DoughnutChart) && series.length !== 1) if( !this.chart.plotArea.chart.varyColors || (this.chart.plotArea.chart.getObjectType() !== historyitem_type_PieChart && this.chart.plotArea.chart.getObjectType() !== historyitem_type_DoughnutChart) && series.length !== 1)
{ {
for(i = 0; i < series.length; ++i) for(i = 0; i < series.length; ++i)
{ {
......
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