score:7

Accepted answer

I assume you are using the labratrevenge/d3-tip script to get tooltips like in here

This means you need to have elements to attach the tip.hide and tip.show callbacks to.

You can do this by adding circle points to the chart and attach the callbacks to these points:

svg.selectAll(".circle")
     .data(data)
     .enter()
     .append("svg:circle")
     .attr("class", "circle")
     .attr("cx", function (d) {
        return x(d.date);
     })
     .attr("cy", function (d) {
       return y(d.close);
     })
     .attr("r", 5)
     .on('mouseover', tip.show)
     .on('mouseout', tip.hide)

Have a look at it in action on jsfiddle.


Related Query

More Query from same tag