Echarts X軸數據過多導致重疊顯示不全的問題


用Echarts做可視化分析的時候遇到了一個問題,日期有100多個,將其全部顯示出來,密密麻麻的。

警告!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

密集恐懼症請先行撤退!!!

圖如下:

非常失敗的一個畫圖;

        xAxis: {
            type: 'category',
            boundaryGap: true,
            //x 軸
            data: time,
            axisLabel: {
                interval: 0,
                rotate: 35
            }
        },

我的X軸設置是這樣的,其中在axisLabel中,interval為0,rotate代表一個旋轉量;

這就是問題所在!!

interval為0代表每個標簽都顯示,即間隔為0!

將其設置為我們想要的數值即可。

即:

        xAxis: {
            type: 'category',
            boundaryGap: true,
            //x 軸
            data: time,
            axisLabel: {
                interval: 6,
                rotate: 35
            }
        },

這樣,效果就好點了,如下:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM