NVD3, Clear svg before loading new chart
This works for me:
var svg = d3.select("svg");
svg.selectAll("*").remove();
You can select all the elements below the SVG with the "svg > *"
selector, i.e. to remove all of those, do
d3.selectAll("svg > *").remove();