echarts X轴显示不全

项目中有遇到X轴显示不全的问题:


代码如下:

"xAxis": {
    "axisLine": {
        "lineStyle": {
            "color": "#fcead4",
            "fontSize": 14
        }
    },
    "type": "category",
    "data": ["打算花多少钱","实际花多少钱","肥料","农药","工具","种苗","设备","人工","灌溉","其他"],
    "boundaryGap": true,
    "axisTick": {
        "show": false
    },
    "axisLabel": {
        "margin": 8,
        "textStyle": {
            "color": "#676767"
        }
    }
},

解决办法:

"axisLabel": {
    "margin": 8,
    "interval":0,//解决代码
    "textStyle": {
        "color": "#676767"
    }
}


这个是坐标轴刻度标签的显示间隔,默认情况下会采用标签不重叠的策略间隔显示标签,在这可以直接设置为0强制显示所有标签



ok  希望可以帮助到大家!


你可能感兴趣的:(echarts)