所以我一直在尝试使用 D3plus 将文本包裹在圆圈内,但没有成功。在我的应用程序中,我有几个圆圈/文本对,组合成一个“g”元素。在我的代码中,在创建“g”元素并向其附加圆圈和文本后,我调用 d3plusd3plus.textwrap()
函数,如下所示:
d3plus.textwrap()
//selecting the first text element
.container(d3.select("#Text0"))
.draw();
但是,文本并没有被包装,而是消失了。文本仍然作为 DOM 中的元素可见,但由于某种原因,它的大小变为 0x0。有谁知道这里有什么问题?