1、Y轴格式化用法:
yAxis: {
data:[{
calibration:true,
position:'left',
title:'折线',
titleFontSize:12,
format:(val)=>{return val.toFixed(0)+'度'}
}],
showTitle:true,
gridType:'dash',
dashLength:4,
splitNumber:5
}
2、饼图类格式化
"chartData": {
"series": [{
"name": "一班",
"data": 50
}, {
"name": "二班",
"data": 30
}, {
"name": "三班",
"data": 20
}, {
"name": "四班",
"data": 18
}, {
"name": "五班",
"data": 8
}]
}
for(let i = 0 ;i < chartData.series.length;i++){
chartData.series[i].format=()=>{return chartData.series[i].name+chartData.series[i].data};
}