|
发表于 2018-11-2 18:22:12
|
显示全部楼层
这个效果实现方法如下截图
代码:
labels: {
style: {
fontSize: '10px'
},
formatter: function() {
var labelVal = this.value;
var reallyVal = labelVal;
var lvl = labelVal.length;
if(lvl > 8 && lvl <=16){
reallyVal = labelVal.substr(0,8)+"<br/>"+labelVal.substring(8,lvl);
}else if(lvl > 16 && lvl <=24){
reallyVal = labelVal.substr(0,8)+"<br/>"+labelVal.substr(8,8)+"<br/>"+labelVal.substring(16,lvl);
}else if(lvl > 24){
reallyVal = labelVal.substr(0,8)+"<br/>"+labelVal.substr(8,8)+"<br/>"+labelVal.substr(16,8)+"<br/>"+labelVal.substring(24,lvl);
}
return reallyVal;
}
}
不行的话自己写,也是改这个formatter
|
|