【问题标题】:Draw an ellipse with only few dynamic points in RaphaelJS在 RaphaelJS 中绘制一个只有很少动态点的椭圆
【发布时间】:2013-07-18 10:52:37
【问题描述】:

我正在尝试使用 RaphaelJS 绘制一个好看的椭圆,同时只有椭圆的顶部、底部、左侧和右侧点的坐标。下图更好地说明了我需要什么:

Example showing only the points and then the full ellipse

我已经尝试使用 path 方法允许的大多数基于 curveto 的命令,但它们都没有达到我需要的程度,坦率地说,我无法绕过 elliptical-arc 命令 (A)。

有什么办法可以解决这个问题?

【问题讨论】:

    标签: svg raphael ellipse


    【解决方案1】:

    您只需要使用拉斐尔椭圆:DEMO

    var r = new Raphael(10,10, 500, 500);
    var e = r.ellipse(50, 50, 40, 20).attr({fill: 'yellow', stroke:"red"});
    

    这里ellipse(x, y, rx, ry)

    • 中心的x坐标
    • 中心的y坐标
    • 水平半径
    • 垂直半径

    希望这是你想要的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-21
      • 1970-01-01
      • 2017-07-20
      • 2016-08-26
      • 2012-07-10
      相关资源
      最近更新 更多