cancel
Showing results for 
Search instead for 
Did you mean: 

Script to reduce the size of the pie chart category labels is attached below

Sijo1995
9 - Travel Pro
9 - Travel Pro

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

0 REPLIES 0