在 ECharts 中,柱形图的 x 轴文字默认是居中显示的,如果想要将其居右显示,可以通过设置 'textStyle' 中的 'textAlign' 属性来实现。以下是一个示例代码:

option = {
    xAxis: {
        type: 'category',
        data: ['A', 'B', 'C', 'D', 'E'],
        axisLabel: {
            textStyle: {
                textAlign: 'right' // 设置 x 轴文字居右显示
            }
        }
    },
    yAxis: {
        type: 'value'
    },
    series: [{
        data: [100, 200, 150, 80, 70],
        type: 'bar'
    }]
};

通过设置 'axisLabel' 的 'textStyle' 中的 'textAlign' 属性为 'right',就可以将 x 轴文字居右显示。

希望对你有帮助!

Echarts 柱形图 X 轴文字居右显示方法