javascript - 可缩放的冰柱 d3 在图表中添加标签

标签 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

最佳答案

在您的 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/

相关文章:

javascript - 帮助将 DropDown 事件更改为单选按钮触发器 - javascript

php - 将 mysql 加载到 NVD3 的 json

swt - 如何将标签添加到 SET Scale 刻度?

javascript - 标签层中的 Mapbox 弹出窗口?

javascript - 将 qTip2 与 jQuery 矢量 map (jqvmap) 结合使用

javascript - 超时完成后多次运行去抖功能

javascript - promise 的顺序和并行处理

javascript - d3 json加载错误未捕获类型错误: Cannot read property 'length' of undefined

javascript - 如何为 d3.behavior.zoom 禁用双击缩放?

Javascript/D3 --- 标签的条件格式