我对为什么能够创建svg甚至在页面的DOM中定义圆形感到困惑,但是,圆形没有像在矩形中那样显示在页面上。
var svgContainer = d3.select("body").append("svg")
.attr("width", 200)
.attr("height", 200);
var populations = svgContainer.selectAll("circle")
.data(jsonCircle)
.enter()
.append("circle");
var populationAttributes = populations
.attr("x", function (d) { return d.x_axis; })
.attr("y", function (d) { return d.y_axis; })
.attr("radius", function (d) {return d.radius;})
.style("fill", function (d) {return d.color;});
我正在尝试按照d3完全破折号的示例进行操作,但用圆形而不是矩形(https://www.dashingd3js.com/dynamic-svg-coordinate-space)
圆的属性不是x,y和半径,而是cx,cy和r。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句