我已阅读有关将标签插入 d3 图表的帖子,但我没有看到文本
这是帖子:How to add to text to the Zoomable Icicle d3 graph?
这是我的页面,代码为:http://mirkotinelli.altervista.org/icicle/altro.html
最佳答案
在您的 source 的以下行中
.text(function(d) { return d.key })
您引用的 d.key
在您的 json 中不存在。
将 d.key
替换为 d.name
.text(function(d) { return d.name })
关于javascript - 可缩放的冰柱 d3 在图表中添加标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23966623/