Commit 128a7eb7 authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix Bug 34178

parent 272f5ee8
...@@ -4284,28 +4284,25 @@ DrawingObjectsController.prototype = ...@@ -4284,28 +4284,25 @@ DrawingObjectsController.prototype =
ret.putVertAxisLabel(_label); ret.putVertAxisLabel(_label);
var data_labels = plot_area.charts[0].dLbls; var data_labels = plot_area.charts[0].dLbls;
var nDefaultDatalabelsPos = chart_type && chart_type.getDefaultDataLabelsPosition ? chart_type.getDefaultDataLabelsPosition() : c_oAscChartDataLabelsPos.none;
if(data_labels) if(data_labels)
{ {
var nDefaultDatalabelsPos = chart_type && chart_type.getDefaultDataLabelsPosition ? chart_type.getDefaultDataLabelsPosition() : c_oAscChartDataLabelsPos.none; this.collectPropsFromDLbls(nDefaultDatalabelsPos, data_labels, ret);
ret.putShowSerName(data_labels.showSerName === true); }
ret.putShowCatName(data_labels.showCatName === true); else
ret.putShowVal(data_labels.showVal === true); {
ret.putSeparator(data_labels.separator); if(chart_type.series[0] && chart_type.series[0].dLbls){
if(data_labels.showSerName || data_labels.showCatName || data_labels.showVal){ this.collectPropsFromDLbls(nDefaultDatalabelsPos, chart_type.series[0].dLbls, ret);
ret.putDataLabelsPos(AscFormat.isRealNumber(data_labels.dLblPos) ? data_labels.dLblPos : nDefaultDatalabelsPos);
} }
else{ else{
ret.putShowSerName(false);
ret.putShowCatName(false);
ret.putShowVal(false);
ret.putSeparator("");
ret.putDataLabelsPos(c_oAscChartDataLabelsPos.none); ret.putDataLabelsPos(c_oAscChartDataLabelsPos.none);
} }
} }
else
{
ret.putShowSerName(false);
ret.putShowCatName(false);
ret.putShowVal(false);
ret.putSeparator("");
ret.putDataLabelsPos(c_oAscChartDataLabelsPos.none);
}
if(chart.legend) if(chart.legend)
{ {
...@@ -4582,6 +4579,19 @@ DrawingObjectsController.prototype = ...@@ -4582,6 +4579,19 @@ DrawingObjectsController.prototype =
ret.type = calc_chart_type; ret.type = calc_chart_type;
return ret; return ret;
}, },
collectPropsFromDLbls: function(nDefaultDatalabelsPos, data_labels, ret){
ret.putShowSerName(data_labels.showSerName === true);
ret.putShowCatName(data_labels.showCatName === true);
ret.putShowVal(data_labels.showVal === true);
ret.putSeparator(data_labels.separator);
if(data_labels.showSerName || data_labels.showCatName || data_labels.showVal){
ret.putDataLabelsPos(AscFormat.isRealNumber(data_labels.dLblPos) ? data_labels.dLblPos : nDefaultDatalabelsPos);
}
else{
ret.putDataLabelsPos(c_oAscChartDataLabelsPos.none);
}
},
_getChartSpace: function (chartSeries, options, bUseCache) { _getChartSpace: function (chartSeries, options, bUseCache) {
switch (options.type) { switch (options.type) {
case c_oAscChartTypeSettings.lineNormal: case c_oAscChartTypeSettings.lineNormal:
......
...@@ -1129,6 +1129,10 @@ CChartSpace.prototype.applyLabelsFunction = function(fCallback, value) ...@@ -1129,6 +1129,10 @@ CChartSpace.prototype.applyLabelsFunction = function(fCallback, value)
var dLbl = ser.dLbls.findDLblByIdx(pts[i].idx); var dLbl = ser.dLbls.findDLblByIdx(pts[i].idx);
if(dLbl) if(dLbl)
{ {
if(ser.dLbls.txPr && !dLbl.txPr)
{
dLbl.setTxPr(ser.dLbls.txPr.createDuplicate());
}
fCallback(dLbl, value, this.getDrawingDocument(), 10); fCallback(dLbl, value, this.getDrawingDocument(), 10);
} }
} }
......
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