Echarts--小记

  • 需求在Echarts的图例后面加上最大的数值
  • 使用legend. formatter

  • 例:折线图有两个图例1,2
formatter: function(name) {
                                let max 
                                if(name =='图例1'){
                                  max = Math.max(...图例1)
                                } else {
                                  max = Math.max(...图例2)
                                }
                                return name + "  " + '('+ max+ ')';
                            
    },

 

posted on 2022-02-23 11:19  白昊天  阅读(24)  评论(0)    收藏  举报

导航