我试图用d3.js为s svg:image(嵌入在SVG中的图像)制作圆角.我无法找到如何正确设置图像样式,因为根据W3C规范,我应该可以使用CSS,但更好的边框和圆角边缘对我有效.
提前致谢.
vis.append("svg:image")
.attr("width", width/3)
.attr("height", height-10)
.attr("y", 5)
.attr("x", 5)
.attr("style", "border:1px solid black;border-radius: 15px;")
.attr("xlink:href",
"http://www.acuteaday.com/blog/wp-content/uploads/2011/03/koala-australia-big.jpg");
Run Code Online (Sandbox Code Playgroud)
编辑:
浏览器测试:Firefox,Chrome