Echarts y轴标题配置探讨

25 阅读1分钟

下面这种方法y轴的单位会因为y轴数字大小显示不全

yAxis: {
    type: 'value',
    name: "单位:元",
    nameTextStyle: {
        padding:[0,0,0,60],    // 文字块  [上右下左]
        color: "#000",
        fontSize: 14,
        fontWeight: 700
    },
},

所以使用下面这种方式

title: [
    {
        text: '单位:元',
        left: 10,
        top: 0,
        textStyle: {
            fontSize: 14,
            fontWeight: 700,
            color: "#000",

        }
    },
],