I created a svg using D3. However, it only shows up on the upper left conner of the screen, or been appended to another svg. Are there anyway I can move it using JavaScript? For
Instead of appending SVG to the body, append it to a html element like Javascript: HTML:
add this to your body tag. If you want to align svg using javascript, remove Alternatively, You could also do it using D3.var svg = d3.select("#chart").append("svg")
.attr("width", 200)
.attr("height", 200);
align
attribute in the above document.getElementById("chart").align = "center";
d3.select("#chart")
.attr("align","center");