我找了一整天都找不到这个问题的答案。我刚接触排行榜,但似乎并不难做到…
这是我在脚本中的内容:
tooltip: {
formatter: function() {
return '<b>'+ this.point.name +'</b>: '+ Math.round(this.percentage) +' %';
}
},
我只想显示this.point.name
的前8个字符请帮忙!
你应该能够在这个函数中使用标准的javascript,例如substring()。
tooltip: {
formatter: function() {
return '<b>'+ this.point.name.substring(0,7) +'</b>: '+ Math.round(this.percentage) +' %';
}
},