如何在D3中绘制部分椭圆?

时间:2014-06-20 06:46:06

标签: d3.js

我基本上想要创建一个部分椭圆,比如半椭圆,我可以使用内置的D3椭圆方法来实现,如果没有那么我怎么能够实现这个呢?

1 个答案:

答案 0 :(得分:0)

使用SVG绘制半个椭圆, 仍在寻找使用d3。 以下是您的代码,

<svg>
   <clipPath id="cut-off-bottom">
       <rect height="100" width="200" y="0" x="0">
    </clipPath>
    <ellipse clip-path="url(#cut-off-bottom)" ry="30" rx="100" cy="100" cx="100">
</svg>

如果您想了解更多关于如何绘制的内容,请点击链接https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Clipping_and_masking