问题
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轴标签在柱状图上垂直居中 生效