【发布时间】:2014-02-26 10:10:50
【问题描述】:
在以下 d3.js 代码中:
svg.selectAll(".bar")
.data(data)
.enter()
.append("rect")
.attr("transform", "translate(10,0)")
.attr("class", "bar")
.attr("x", function(d) { return x(d.thread_id); })
.attr("width", x.rangeBand())
.attr("y", function(d) { return y(+d.traffic); })
.attr("height", function(d) { return height - y(+d.traffic); })
.on('mouseover', tip.show) // First time call to show a tooltip
.on('mouseover', justChecking) // Second time to call a Function
.on('mouseout', tip.hide);
当我执行此代码时,只显示第二个函数输出,但工具提示消失了。
我想在鼠标悬停时同时调用它们,即调用函数并显示工具提示。有什么想法值得赞赏吗?
【问题讨论】:
标签: javascript css d3.js tooltip mouseover