如样例,如何让Y轴显示出以Mbps,Kpbs等为单位的坐标轴,且不显示出小数点
配置项如下
option = {
title: {
text: 'Awesome Chart'
},
xAxis: {
data: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
},
grid:{
left:'18%'
},
yAxis: {
type: 'value',
axisLabel:{
formatter:function(value,index){
if(value>1024*1024){
return parseInt(value/1024/1024)+"Mpbs";
}else if(value>1024){
return parseInt(value/1024)+"kpbs";
}else{
return parseInt(value)+"bps"
}
}
},
},
series: [{
type: 'line',
data:[288320, 342342, 43511, 344534, 454290, 4343330, 324310]
}]
};