3
追加我使用此代码如何在d3.js图像轮
node.append("image")
.attr("xlink:href", function(d) { return d.img; })
.attr("x", -25)
.attr("y", -25)
.attr("width", 50)
.attr("height", 50)
我想要的形象是圆我曾尝试使用此代码的图像
.attr("style", "border-radius: 30px;");
但它没有工作..我也试过这一个
<style>
.node image{
border-color: 2px solid orange;
border-radius: 25px;
}
</style>
但无济于事。 。
您也可以使用clipPath做相反的操作,将图像裁剪成圆形,而不是用图像填充圆形。 [**示例**](http://jsfiddle.net/fppsru68/1/) – jshanley 2014-08-27 21:05:13
这是好的,但问题是我有一个动态的图像集。 – 2014-08-28 01:56:18
你能举一个你有什么困难的例子吗? – minikomi 2014-08-28 02:18:58