score:3

Accepted answer

Do it like this Add the image url inside your data like this:

 "nodes": [
    {
      "type": "S",
      "id": "1",
      "name": "100",
            "img":"https://lh4.ggpht.com/Tr5sntMif9qOPrKV_UVl7K8A_V3xQDgA7Sw_qweLUFlg76d_vGFA7q1xIKZ6IcmeGqg=w300"
    },

To the node add image like this:

nodeEnter
    .append("image")
  .attr("xlink:href", function(d) { return d.img; })
  .attr("x", "-12px")
  .attr("y", "-44px")
  .attr("width", "24px")
  .attr("height", "24px");

  ;

Working code here

Hope this helps!


Related Query