highchart中的function()属性赋值
yAxis: {
title: {
text: 'Nuclear weapon states'
},
labels: {
formatter: function() {
return this.value / 1000 +'k';
}
}
}
var labels = new Object();
labels.formatter =?????//不知道这块如何写?
options.yAxis.labels=labels;
------解决方案--------------------
labels.formatter = function() {
return this.value;
};
return的值取决于楼主想要怎样的格式,例如是金钱的话,就是:
return “$” + this.value;