Sijo1995
02-08-2023Cloud Apps
Script to reduce the size of the pie chart category labels is attached below
Hi Team ,
Script to reduce the size of the pie chart category labels is attached below
widget.on("beforeviewloaded",function(widget,args){
var maxCharNum = 28
var value
args.options.plotOptions.pie.dataLabels.formatter = function (){
value = chunk(this.key.trim(), maxCharNum).join('<br>');
return value;
}
args.options.plotOptions.pie.dataLabels.useHTML = true
});
function chunk(str, n) {
var ret = [];
var i;
var len;
for(i = 0, len = str.length; i < len; i += n) {
// console.log(str.substr(i, n))
ret.push(str.substr(i, n))
}
return ret
};
Thanks
Sijo