SVG not displaying correctly in D3.js dataviz

Viewed 40

In this datavisualization, I have a curious problem : my svg is not correctly aligned with the whole container.

I'm using a viewbox:

var svg = d3.select("#viz")
.attr("viewBox", [
    margin.left,
    margin.top,
    (width+margin.left),
    (height+margin.bottom)
  ].join(" "))
.append("svg")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");

Does anyone have any idea why?

0 Answers
Related