js-components-svg-circle.md 3.8 KB
Newer Older
Z
zengyawen 已提交
1 2 3 4 5
# circle<a name="ZH-CN_TOPIC_0000001127284906"></a>

圆形形状。

>![](../../public_sys-resources/icon-note.gif) **说明:** 
Z
zengyawen 已提交
6
>该组件从API version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
Z
zengyawen 已提交
7 8 9 10 11 12 13 14 15 16 17

## 权限列表<a name="section11257113618419"></a>



## 子组件<a name="section9288143101012"></a>

支持animate、animateMotion、animateTransform。

## 属性<a name="section2907183951110"></a>

Z
zengyawen 已提交
18
支持Svg组件[通用属性](js-components-svg-common-attributes.md)和以下属性。
Z
zengyawen 已提交
19

Z
zengyawen 已提交
20
<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p>名称</p>
Z
zengyawen 已提交
21
</th>
Z
zengyawen 已提交
22
<th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.2"><p>类型</p>
Z
zengyawen 已提交
23
</th>
Z
zengyawen 已提交
24
<th class="cellrowborder" valign="top" width="10.48%" id="mcps1.1.6.1.3"><p>默认值</p>
Z
zengyawen 已提交
25
</th>
Z
zengyawen 已提交
26
<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.6.1.4"><p>必填</p>
Z
zengyawen 已提交
27
</th>
Z
zengyawen 已提交
28
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p>描述</p>
Z
zengyawen 已提交
29 30 31
</th>
</tr>
</thead>
Z
zengyawen 已提交
32
<tbody><tr><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p>id</p>
Z
zengyawen 已提交
33
</td>
Z
zengyawen 已提交
34
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p>string</p>
Z
zengyawen 已提交
35
</td>
Z
zengyawen 已提交
36
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p>-</p>
Z
zengyawen 已提交
37
</td>
Z
zengyawen 已提交
38
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
39
</td>
Z
zengyawen 已提交
40
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p>组件的唯一标识。</p>
Z
zengyawen 已提交
41 42
</td>
</tr>
Z
zengyawen 已提交
43
<tr><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p>cx</p>
Z
zengyawen 已提交
44
</td>
Z
zengyawen 已提交
45
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;|&lt;percentage&gt;</p>
Z
zengyawen 已提交
46
</td>
Z
zengyawen 已提交
47
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p>0</p>
Z
zengyawen 已提交
48
</td>
Z
zengyawen 已提交
49
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
50
</td>
Z
zengyawen 已提交
51
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p>设置圆心的x轴坐标。支持属性动画</p>
Z
zengyawen 已提交
52 53
</td>
</tr>
Z
zengyawen 已提交
54
<tr><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p>cy</p>
Z
zengyawen 已提交
55
</td>
Z
zengyawen 已提交
56
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;|&lt;percentage&gt;</p>
Z
zengyawen 已提交
57
</td>
Z
zengyawen 已提交
58
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p>0</p>
Z
zengyawen 已提交
59
</td>
Z
zengyawen 已提交
60
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
61
</td>
Z
zengyawen 已提交
62
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p>设置圆心的y轴坐标。支持属性动画</p>
Z
zengyawen 已提交
63 64
</td>
</tr>
Z
zengyawen 已提交
65
<tr><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p>r</p>
Z
zengyawen 已提交
66
</td>
Z
zengyawen 已提交
67
<td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;|&lt;percentage&gt;</p>
Z
zengyawen 已提交
68
</td>
Z
zengyawen 已提交
69
<td class="cellrowborder" valign="top" width="10.48%" headers="mcps1.1.6.1.3 "><p>0</p>
Z
zengyawen 已提交
70
</td>
Z
zengyawen 已提交
71
<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
72
</td>
Z
zengyawen 已提交
73
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p>设置圆的半径。支持属性动画</p>
Z
zengyawen 已提交
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
</td>
</tr>
</tbody>
</table>

## 示例<a name="section360556124815"></a>

```
<!-- 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>
```

![](figures/zh-cn_image_0000001173164853.png)