为什么我可以在D3中创建圆而不是椭圆?

时间:2014-09-03 14:19:11

标签: javascript d3.js

我有以下代码创建一个圆圈:

SVGTTest.selectAll("circle")
    .data(dataset)
    .enter().append("circle")
    .attr("cx", xScale(300))
        .attr("cy", yScale(10))
        .attr("r", xScale(100));

当我尝试创建椭圆而不是圆形时,我尝试以下代码,但没有任何反应。任何帮助都会有所帮助..

SVGTTest.selectAll("ellipse")
    .data(dataset)
    .enter().append("ellipse")
    .attr("cx", yScale(300))
        .attr("cy", yScale(10))
        .attr("rx", xScale(100))
        .attr("ry", 100);

0 个答案:

没有答案