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

fix Bug 34178

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