score:1

Accepted answer

First thing that comes to mind is making sure you are selecting the correct HTML element (body, #div2, etc).

svg = d3.select("#rightDiv")
   .append("svg")
   .attr("width", w + margin.left + margin.right)
   ...;

Related Query

More Query from same tag