Skip to content Skip to sidebar Skip to footer

Get Attributes Of Existing Svg Elements And Bind As Data With D3.js

I have an existing svg element such as:

Solution 1:

Does this work for you?

d3.selectAll('circle').datum(function() {
  return parseFloat(this.getAttribute('cx'));
});

Post a Comment for "Get Attributes Of Existing Svg Elements And Bind As Data With D3.js"