关于javascript:echart-设置-Y轴标签在柱状图上垂直居中-失效

4次阅读

共计 266 个字符,预计需要花费 1 分钟才能阅读完成。

问题

yAxis: {
      type: 'category',
      data: yAxis,
      axisLabel: {
        inside: true,
        *verticalAlign: 'middle'*
        // 文档中应该是这个属性来设置垂直居中,然而未失效
      },
      axisLine: {
        lineStyle: {color: '#fff',},
      },
      zlevel: 1,
    },

解决

设置 textStyle lineHeight

axisLabel:{
       textStyle:{
          color: "#444",
          fontSize: 8,
          lineHeight: 9
       },
}

echart 设置 Y 轴标签在柱状图上垂直居中 生效

正文完
 0