如何隐藏D3缩放包布局中的标签的重叠文本? [英] How to Hide Overlapping Text of Labels in D3 Zoomable Pack Layout?
问题描述
我使用的是D3网站上提供的Zoomable Pack版式: http://mbostock.github.io/d3/talk/20111116/pack-hierarchy.html
显示布局时会显示所有圆形标签。 p>
问题是,对于靠近在一起的小圆圈,标签重叠。我想知道是否有一种方法隐藏标签的重叠文本?
我已经阅读了关于foreignobject,但如果这是答案,我
您可以根据级别限制显示文本,圆的半径或两者的组合。两者都在包输出。使用悬停详细信息的标题。
I am using the Zoomable Pack Layout provided on the D3 website: http://mbostock.github.io/d3/talk/20111116/pack-hierarchy.html
All labels of the circles are displayed when the layout is displayed.
The problem is that for small circles which are close together, the labels overlap. I would like to know if there is a way to hide the overlapping text of the labels?
I have read about "foreignobject", but if this is the answer, I am not sure how and where to incorporate it in the code.
You could restrict the display of text based on either the level of the hierarchy, the radius of the circle or a combination of both. Both are in the pack output. Use titles for hover detail.
这篇关于如何隐藏D3缩放包布局中的标签的重叠文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!