【发布时间】:2015-07-31 18:38:50
【问题描述】:
我创建了鼠标悬停函数来显示我的折线图的 x 和 y 坐标。我想在鼠标悬停事件时显示正确的 x 和 y 坐标位置。有人可以帮我找出如何重写工具提示函数以显示正确的 x 和 y 坐标。谢谢。
var tooltip = d3.select("body")
.data(data)
// .enter()
.append("div")
.style("position", "absolute")
.style("z-index", "10")
.style("visibility", "hidden")
.text(function(d){console.log((d.Mass+ ","+ d.Intensity));return (d.Mass+ ","+ d.Intensity);});
折线图的链接在以下位置。
【问题讨论】:
-
您在寻找这样的东西吗? stackoverflow.com/questions/11368096/…
标签: javascript jquery d3.js