echars用rich设置label位置出现不统一的问题?

demo在这:https://jsrun.net/rQsKp/edit
echars自定义label的圆点之后,设置label的文字在圆点的外侧,但总有一侧在内部。
通过rich设置label位置,饼图左边的没有问题,右边的出问题。设置右边位置,左边就出问题?
image.png

option = {
  series: [
    {
      type: 'pie',
      radius: '70%',
      label: {
        normal: {
          fontSize: "12",
          color: "#fff",
          lineHeight: 17,
          backgroundColor: "auto", //圆点颜色,auto:映射的系列色
          // height,width,lineHeight必须为0
          height: 0,
          width: 0,
          lineHeight: 0,
          borderRadius: 4.5,
          padding: [4.5, -4.5, 4.5, -4.5],
          formatter: '{a|{b}}\n{d|{d}%}{c|{c}}',
          rich: { // 自定义富文本样式
                a: {
                  padding: [-30, 15, -15, -80],
                },
                c: {
                  padding: [0, 55, -15, -70]
                },
                d: {
                  padding: [0, 5, -15, -70]
                }
              }
        },
      },
      labelLine: {
        length: 35,
        length2:30
      },
      data: [
        { value: 1048, name: '1231111111111111111111111111111111111111' },
        { value: 735, name: 'Direct' },
        { value: 580, name: 'Email' },
        { value: 484, name: 'Union Ads' },
        { value: 300, name: 'Video Ads' }
      ],
    }
  ]
};
阅读 1.2k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题