我正在使用svg:image将图像导入D3。我以为我正确地做了,但似乎没有工作:
d3.selectAll("#chart").append("svg:image")
.attr("xlink:href", "http://www.e-pint.com/epint.jpg ")
.attr("width", "150px")
.attr("height", "200px");
以下是问题的视觉效果 - 不确定我哪里出错 - http://jsfiddle.net/xwZjN/16/
请帮忙
答案 0 :(得分:0)
您需要将svg:image
放在svg
元素中。使用此:
d3.select("#chart").select("svg").append("svg:image")
.attr("xlink:href", "http://www.e-pint.com/epint.jpg ")
.attr("width", "150px")
.attr("height", "200px");