How to set the interval of coordinate axes in Echarts?

In ECharts, you can use the axisLabel.interval property to set the display interval of axis labels.

For example, if you want to set the X-axis labels to display every 2 intervals, you can use the following code:

xAxis: {
    type: 'category',
    data: ['A', 'B', 'C', 'D', 'E', 'F', 'G'],
    axisLabel: {
        interval: 2
    }
}

Similarly, if you want to set the Y-axis labels to display every 3, you can use the following code:

yAxis: {
    type: 'value',
    axisLabel: {
        interval: 3
    }
}

You can flexibly control the display interval of axis labels by setting the axisLabel.interval property.

bannerAds