I have to make this d3 chart responsive. I am using
var svg = d3.select("div#container")
.append("svg")
.attr("preserveAspectRatio", "xMinYMin meet")
.attr("viewBox", "0 0 300 300")
.classed("svg-content", true);
and the class has
.svg-content {
display: inline-block;
position: absolute;
top: 0;
left: 0;
}
But it doesnot seem to work. Here's the working fiddle https://jsfiddle.net/84hp8m6p/1/