在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Java  HTML/ echarts 圖例 怎么實現(xiàn)一樣的寬度

echarts 圖例 怎么實現(xiàn)一樣的寬度

如圖,需要上下對齊,想把每個圖例設置一樣寬,但是文檔里找不到這項配置。

clipboard.png

回答
編輯回答
無標題

最新更新:

找到解決辦法,用富文本方式可以指定寬度:

legend: {
                   orient: 'horizontal',
                   itemWidth: 14,
                   itemHeight: 14,
                   left: 13,
                   bottom: 35,
                   icon: 'circle',
                   formatter:'{a|{name}}',
                   textStyle: {
                        rich:{
                            a: {
                                color: '#ddd',
                                fontSize: 15,
                                width: 95,
                                height: 21,
                                padding: [0,0,0,1]
                            },
                        }
                   },
                }



------------------------------------------------------------------------

之前的答案:
找到一個方法,但是有點不智能,暫時解決了問題。

legend可以分開設置:改變定位值就可以了。

legend: [
            {  
                orient: 'horizontal',  
                left: 13,
                bottom: 68,  
                data: ['20M以下'] 
            },
            {  
                orient: 'horizontal',  
                left: 141,
                bottom: 68,  
                data: ['20M-49M'] 
            },
            ...
        ]

在官方文檔里發(fā)現(xiàn)了這個,說起來應該可以解決問題,但是不知道為什么不生效,有時間的朋友可以研究下:http://echarts.baidu.com/opti...

clipboard.png

2018年6月9日 00:06