标签: javascript d3.js label icicle-diagram
我已阅读有关在d3图表中插入标签的帖子,但我看不到文字
这是帖子:How to add to text to the Zoomable Icicle d3 graph?
这是我的页面,代码为:http://mirkotinelli.altervista.org/icicle/altro.html
答案 0 :(得分:2)
在source
.text(function(d) { return d.key })
您引用了json中不存在的d.key。
d.key
将d.key替换为d.name
d.name
.text(function(d) { return d.name })