您可以使用series.dataLabels.formatter
回调格式化数据标签。检查下面发布的演示和代码。
码:
series: [{
name: 'NSV',
color: 'rgba(165,170,217,1)',
data: [38891, 35098, 21296, 19345, 19092],
pointPadding: 0.3,
pointPlacement: -0.2
}, {
name: 'Margin',
color: 'rgba(126,86,134,.9)',
data: [8594.911, 6422.934, 5302.704, 580.35, 3417.468],
pointPadding: 0.4,
pointPlacement: -0.2,
dataLabels: {
formatter: function() {
var chart = this.series.chart,
percentage = (this.y / chart.series[0].points[this.point.index].y) * 100;
return percentage.toFixed(1) + '%';
}
}
}]
演示:
API参考: