circle

圆形形状。

说明: 从API Version 7 开始支持。

权限列表

子组件

支持animate、animateMotion、animateTransform。

属性

支持所列的Svg组件通用属性和以下表格的属性。

名称

类型

默认值

必填

描述

id

string

-

组件的唯一标识。

cx

<length>|<percentage>

0

设置圆心的x轴坐标。支持属性动画

cy

<length>|<percentage>

0

设置圆心的y轴坐标。支持属性动画

r

<length>|<percentage>

0

设置圆的半径。支持属性动画

示例

<!-- xxx.hml -->
<div class="container">
    <svg fill="white" width="400" height="400">
        <circle cx="60" cy="200" r="50" stroke-width="4" fill="red" stroke="blue"></circle>
        <circle cx="180" cy="200" r="50" stroke-width="10" stroke="red" stroke-dasharray="10 5" stroke-dashoffset="3"></circle>
    </svg>
</div>