我正在构建一个带有缩放、刷亮、复选框等的复杂多线图。我能够完成所有这些工作,但坚持让工具提示工作。我想得到这样的东西
http://bl.ocks.org/benjchristensen/2657838
在特定 x 坐标处具有所有路径值的线
var vertical = d3.select("#main-graph")
.append("div")
.attr("class", "remove")
.style("position", "absolute")
.style("z-index", "19")
.style("width", "1px")
.style("height", "380px")
.style("top", "10px")
.style("bottom", "30px")
.style("left", "0px")
.style("background", "#fff");
d3.select("#main-graph")
.on("mousemove", function(){
mousex = d3.mouse(this);
mousex = mousex[0] + 220 ;
vertical.style("left", mousex + "px" )})
.on("mouseover", function(){
mousex = d3.mouse(this);
mousex = mousex[0] +220 ;
vertical.style("left", mousex + "px")});
});
目前我有上面的代码来获取这条线。我现在将如何获取所有悬停线的数据。感谢任何帮助!