How can I select :last-child in d3.js?

后端 未结 6 2155
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-31 08:55

I need to manipulate the text elements of the first and last tick of an axis to bring them more towards the center.

I am trying to select them, one at t

6条回答
  •  生来不讨喜
    2020-12-31 09:37

    Here's the cleanest method I've found:

    g.selectAll(".tick:first-of-type text").remove();
    g.selectAll(".tick:last-of-type text").remove();
    

提交回复
热议问题