uCharts Y轴格式化

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};
}

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.duanlonglong.com/qdjy/230.html