Echarts fixed Y-axis label name title width

 Controlled by grid

let option = {
        // title: {
        //   text: '职称数量统计',
        //   left: 'center',
        //   top: '15'
        // },
        tooltip: {
          trigger: 'item',
          formatter: '{b} : {c} ' // a  外边 name ; b series  name    c 值   d百分比
        },
        grid: {
          left: '10', // 固定左边刻度宽度
          right: '5%',
          bottom: '5%',
          containLabel: true
        },
        xAxis: {
          type: 'value',
          name: '数量'
        },
        yAxis: {
          type: 'category',
          name: '名称',
          data: ydata,
          axisLabel: {
            interval: 0,
            // inside: true
            // rotate: 20,
            textStyle: {
              align: 'right' // 文字右对齐
            }
          }
        },
      };

 

Guess you like

Origin blog.csdn.net/weixin_50114203/article/details/128639388