1e41f4b71Sopenharmony_ci# Path Drawing 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ciThe **<svg>** component uses instructions **M** (start point), **H** (horizontal line), and **a** (drawing an arc to a specified position) to control a path and sets the fill colors to create a pie chart. 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ci```html 7e41f4b71Sopenharmony_ci<!-- xxx.hml --> 8e41f4b71Sopenharmony_ci<div class="container"> 9e41f4b71Sopenharmony_ci <svg fill="#00FF00" x="100" y="400"> 10e41f4b71Sopenharmony_ci <path d="M300,200 h-150 a150 150 0 1 0 150 -150 z" fill="red" stroke="blue" stroke-width="5" > 11e41f4b71Sopenharmony_ci </path> 12e41f4b71Sopenharmony_ci <path d="M275,175 v-150 a150 150 0 0 0 -150 150 z" fill="yellow" stroke="blue" stroke-width="5"> 13e41f4b71Sopenharmony_ci </path> 14e41f4b71Sopenharmony_ci </svg> 15e41f4b71Sopenharmony_ci</div> 16e41f4b71Sopenharmony_ci``` 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci```css 19e41f4b71Sopenharmony_ci/* xxx.css */ 20e41f4b71Sopenharmony_ci.container { 21e41f4b71Sopenharmony_ci flex-direction: row; 22e41f4b71Sopenharmony_ci justify-content: flex-start; 23e41f4b71Sopenharmony_ci align-items: flex-start; 24e41f4b71Sopenharmony_ci height: 1200px; 25e41f4b71Sopenharmony_ci width: 600px; 26e41f4b71Sopenharmony_ci background-color: #F1F3F5; 27e41f4b71Sopenharmony_ci} 28e41f4b71Sopenharmony_ci``` 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci> **NOTE** 35e41f4b71Sopenharmony_ci> - M/m = moveto The **x** and **y** parameters indicate the destination X and Y coordinates of a point. The **M** command only moves the brush, but does not draw a line between two points. Therefore, the **M** command is often used at the beginning of a path to indicate the start point. 36e41f4b71Sopenharmony_ci> 37e41f4b71Sopenharmony_ci> - L/l = lineto The **x** and **y** parameters indicate the X and Y coordinates of a point. The **L** command draws a line between the current position and the destination position (the previous point of the brush). 38e41f4b71Sopenharmony_ci> 39e41f4b71Sopenharmony_ci> - H/h = horizontal lineto Draws a horizontal line. 40e41f4b71Sopenharmony_ci> 41e41f4b71Sopenharmony_ci> - V/v = vertical lineto Draws a vertical line. 42e41f4b71Sopenharmony_ci> 43e41f4b71Sopenharmony_ci> - C/c = curveto Draws a cubic Bezier curve. Three groups of coordinate parameters are required: **x1 y1**, **x2 y2**, **x y**. 44e41f4b71Sopenharmony_ci> 45e41f4b71Sopenharmony_ci> - S/s = smooth curveto Draws a cubic Bezier curve. Two groups of coordinate parameters are required: **x2 y2**, **x y**. 46e41f4b71Sopenharmony_ci> 47e41f4b71Sopenharmony_ci> - Q/q = quadratic Belzier curve Draws a quadratic Bezier curve. Two groups of coordinate parameters are required: **x1 y1**, **x y**. 48e41f4b71Sopenharmony_ci> 49e41f4b71Sopenharmony_ci> - T/t = smooth quadratic Belzier curveto Draws a quadratic Bezier curve. One group of coordinate parameters are required: **x y**. 50e41f4b71Sopenharmony_ci> 51e41f4b71Sopenharmony_ci> - A/a = elliptical Arc Draw an arc. The following parameters are required: **rx ry x-axis-rotation** (rotation angle), **large-arc-flag** (angle), **sweep-flag** (arc direction), and **x y**. **large-arc-flag** determines whether the arc is less than 180 degrees. **0** indicates yes, and **1** indicates no. **sweep-flag** indicates the direction in which an arc is drawn. **0** indicates that the arc is drawn counterclockwise from the start point to the end point. **1** indicates that the arc is drawn clockwise from the start point to the end point. 52e41f4b71Sopenharmony_ci> 53e41f4b71Sopenharmony_ci> - Z/z = closepath Draws a straight line from the current point to the start point of the path. 54