echarts y轴刻度加单位

echarts y轴刻度加单位

今天学习到的新知识,如何在echarts图表中给刻度加单位。
echarts y轴刻度加单位_第1张图片

方法有很多,我用的是formatter来加单位的:

yAxis: {
        min: 0,
        max: 60,
        type: 'value',
       axisLabel:{
       formatter:'{value} 亿',
       }
   }     

另一种方法是,在Y轴顶部,使用title来说明y轴的含义数据的就行:

option = {
      title: {
           text: "单位为:亿",
      },
…
},

还有一种是

yAxis:  {
      name: "金额",(添加这里)
      type: "value",
     }

你可能感兴趣的:(echarts)