viser icon indicating copy to clipboard operation
viser copied to clipboard

label属性没有提供了 label layout 配置来优化文本标签

Open flym1013 opened this issue 5 years ago • 0 comments

文本便签遮挡想通过 label layout 配置来解决这个问题,但按照G2的配置设置之后,没有任何效果

 const label = ['name', {
    offset: 0,
    textStyle: {
      textBaseline: 'middle',
    },
    layout:{ type:'limit-in-shape' },
    formatter(val) {
      // console.log(val);
      if (val !== 'root') {
        return _this.isOmit ? val.length>4 ? `${val.substr(0, 4)}...` : val : val.length>10 ? `${val.substr(0, 10)}...`:val;
      }
    },
  }];

配置链接 https://segmentfault.com/a/1190000038381747

flym1013 avatar Dec 17 '20 07:12 flym1013