echarts让设置legend宽度不生效

 仔细看源码发现问题了, 是 orient="horizontal" 的时候,只有width会起作用,height为auto;orient="vertical" 的时候只有height会起作用,width为auto。

legend: {
            orient: 'horizontal',
            bottom: 'bottom',
            left: 'center',
            padding: [0, 0, 10, 0],
            width: 200,
            textStyle: {
              width: 50,
              overflow: 'break',
            },
          },

  

posted on 2022-05-13 12:38  阿虾  阅读(1951)  评论(0编辑  收藏  举报

导航