简体   繁体   中英

D3.js how to get the position/offset of x and y axis

For a given plot with a X and Y axis, how would one get the position of the X and Y axis? I guess I would need the offsets of the two axes. Please advise.

Nest your elements in the container element that has the boundaries you want.

For example, if you want that your x axis start in the boundary of the y axis, replace (in line 66)

  svg.append("line")

With

 d3.select(".nv-scatterWrap").append("line")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM