Accepted answer

i think the problem relates to the use of transitions. there are four places where the chart function is called with a selection that has been returned from .transition(), and that appears not to work.

three of the four changes are in lines 63, 69 and 74 of d3linewithlegend.js. each of these three lines reads as follows:


replace each line with

finally, in the index.html file, replace

      .attr('width', width(margin))
      .attr('height', height(margin))

      .attr('width', width(margin))
      .attr('height', height(margin))

after making this change, hovering over the legend worked for me, in chrome, firefox and edge.

transitions were overhauled in d3 version 3.0, so it's perhaps not a surprise that d3 v2 code involving them doesn't work in d3 v3. i can't say i understand them well enough to know exactly where the problem is, but i did observe that if enter the following line in the console"body").transition().transition()

then d3 throws the same exception that i got when i tried to view the visualization you linked to. this led me to avoid a situation where transition() was being called on a selection returned by a call to transition().

Related Query

More Query from same tag