Forum Discussion
zach_myt
01-03-2024Data Pipeline
I found another way to add it if you just want the percentage, just use "this.percentage", and define your decimal points.
widget.on('processresult', function(se, ev) {
//display the percentage on the bar
ev.result.series.forEach(category => {
category.dataLabels = {
enabled: true,
style: {
fontSize: '12px',
fontWeight: 'Bold'
},
formatter: function() {
if (this.y !== 0) {
return this.percentage.toFixed(2) + '%';
} else {
return null;
}
}
};
});
});