I created an XAXIS using d3.axisBottom(). Now I need to store the positions (x and y attributes of the tick text) in a separate variable.
My full code is at codepen https://codepen.io/zubair57/pen/gOLeeOm
When I use below code to get "x and y" attributes, I get value for y attr but null for x attr. Could you tell me why I get null for x attr and how to get correct value
d3.select(".xaxis").selectAll(".tick text").each(function(d,i){
let me=d3.select(this)
console.log(me.attr("x"))
console.log(me.attr("y"))
})