
现在一个需求要求将y轴数据切换为万单位
加入一下代码
        yAxis: {
          type: "value",
          axisLabel: {
            formatter: function (value, index) {
              return value >= 10000 ? parseInt(value / 10000) + "万" : value;
            },
          },
        },效果如下

其中,axisLabel支持两种方式:字符串模板和函数模板,上述是函数模板,字符串模板如下,大家按需选择
 yAxis: {
        type:"value",
        axisLabel:{
            formatter:"{value}毫升"
        }
    },
    series: [
















