之前:

vue Echarts y轴负半轴显示正值 series: [

          {

            name: this.firstSupport,

            type: "bar",

            stack: "总量",

            label: {

              show: true,

              position: "top",

            },

            data: this.datas1,

            color: this.colorSupport[0],

          },

          {

            name: this.secondName,

            type: "bar",

            stack: "总量",

            label: {

              show: true,

              position: "bottom",

              formatter: function (value) {

                return Math.abs(value.data);

              },  //直接添加此方法

            },

            data: this.datas2,

            color: this.colorSupport[1],

          },

        ],

      };

 

修改之后:

vue Echarts y轴负半轴显示正值

相关文章: