2 回答

TA贡献1853条经验 获得超6个赞
nodeEnter.append("svg:image")
.attr('x',-9)
.attr('y',-12)
.attr('width', 20)
.attr('height', 24)
.attr("xlink:href", function(d) {
if(d.type=="root"){
return "resources/images/test.png";}
else if(d.type.toLowerCase()=="A"){
return "resources/icon01/test1.png";}
else if(d.type=="B"){
return "resources/icon01/test2.png";}
})
.append("svg:title")
.text(function(d){
if(d.type=="root"){
return "Root Name:"+d.name;}
else if(d.type=="test"){
return "Name:"+d.name;}
});
添加回答
举报