antvis / F6

F6 is a graph visualization engine which provides quick and smooth operations on mobile devices.
https://f6.antv.vision
MIT License
133 stars 21 forks source link

内置节点rect,设置label,label文字不显示 #128

Closed WenHua39 closed 2 years ago

WenHua39 commented 2 years ago

内置节点rect,设置label,label文字不显示, 内置节点modelRect与image,的document.getByElementId('container')creatImage不存在问题现在有解决方式么?

ICMI commented 2 years ago

这个最好发下相关的代码片段,看起来不是已知问题,需要复现

WenHua39 commented 2 years ago

内置节点rect,设置label,label文字不显示,这个rect的style生效了,但是label不显示出来 return group.addShape('rect', { label: '123', x: 10, y: 10, labelCfg: { style: { fill: '#000', fontSize: 18, }, position: 'bottom', }, attrs: { fill: '#FFF', radius: 15, width: cfg.size[0], height: cfg.size[1], overflow: 'visible', }, // draggable: true, // must be assigned in F6 3.3 and later versions. it can be any value you want name: 'rect-shape', // zIndex: 1, });

ICMI commented 2 years ago

这个是你这边理解错了,添加text是这样添加的, 参见 这里有两个概念,元素图形,元素由图形绘制出来。比如上面你定义的一个元素,由rect和text两个图形组成。

ICMI commented 2 years ago

modelRect 问题参考

WenHua39 commented 2 years ago

好的,感谢