How to move SVG's position in D3?

前端 未结 4 2516
孤城傲影
孤城傲影 2021-02-20 07:35

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

4条回答
  •  盖世英雄少女心
    2021-02-20 08:21

    Use negative value in margin.

    margin = { top: 20, right: -600, bottom: 20, left: 640 }

    The content is added on the left by default. To shift to right, use negative margins. following line will take it to the second right half of the screen.

提交回复
热议问题