echarts legend 自定義圖例


legend: {
                    
                    selectedMode: true,
                    top: 0,
                    right: 0,
                    orient: 'vertical',
                    // itemWidth: 24,
                    // itemHeight: 2,
                    textStyle: {
                        fontFamily: 'ABBvoiceCNSG-Regular',
                        fontSize: 12,
                    },
                    // icon: 'rect',
                    data: [
                        {
                            name:"高嚴重等級報警",
                            icon:'rect',
                        },
                        {
                            name:"低嚴重等級報警",
                            icon: 'rect'
                        },
                        {
                            name:"健康度",
                            icon: 'line'
                        }
                    ]
                },

 

最后:寫的時候遇見一個小問題,改了icon圖例變成空白了,后來發現是要和series里面的name對應起來

 


免責聲明!

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



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