[英]D3Plus Header Modification
I am trying to change the hovertext displayed during a mouseover in D3Plus. 我试图在D3Plus中更改鼠标悬停期间显示的hovertext。 Specifically, I delete the title associated with a set of data.
具体来说,我删除了与一组数据相关的标题。 Here is a photo to describe what I mean, where the red circle denotes the area of my interest:
这是一张描述我的意思的照片,红色圆圈表示我感兴趣的区域:
I have found that I can change all of the elements listed inside of the tooltip so far beside the main header as I would call it. 我发现我可以改变主要标题旁边的工具提示中列出的所有元素,就像我所说的那样。 I have been searching online on various resources and I have not yet found documentation on this subject.
我一直在网上搜索各种资源,我还没有找到关于这个主题的文档。 the ".tooltip(["name"])" was a test.
“.tooltip([”name“])”是一个测试。 My code is as follows
我的代码如下
<script>
var sample_data = [
{"value": 100, "name": "alpha", "growth": 0.9},
{"value": 70, "name": "beta", "growth": 0.4},
{"value": 40, "name": "gamma", "growth": -0.3},
{"value": 15, "name": "delta", "growth": -0.65},
{"value": 5, "name": "epsilon", "growth": 0.7},
{"value": 1, "name": "zeta", "growth": 0.2}
];
var visualization = d3plus.viz()
.container("#viz")
.data(sample_data)
.type("tree_map")
.id("name")
.value(["name"])
.tooltip(["name"])
.size("value")
.color(function(d){
return d.growth > 0 ? "#008800" : "#880000";
})
.draw();
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.