我将用于简单的可视化。
http://bl.ocks.org/KoGor/5994804
我想要向每个路径添加国家名称。我尝试循环遍历国家,但不知道如何与SVG链接。
var world = svg.selectAll("path.land")
.data(countries)
.enter().append("path")
.attr("class", "land")
.attr("d", path)
.attr("class", function(d) { return "land " + d.properties.name; })
,对吧? - Lars Kotthoff