Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/467.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何填充圆中3个点之间的空间? 我必须指出一个圆的边界,在圆圈中间的点上。我想把这三个点之间的空间(饼图)涂成红色(包括“弧”)。它不必在svg中 const AzimuthChart = (props) => { const x1 = 428.9397 const y1 = 159.2263 const x2 = 371.3345 const y2 = 159.0330 return ( <div className="App"> <svg preserveAspectRatio="xMidYMin" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 400"> <g fill="#61DAFB"> <circle cx="400" cy="200" r="50"/> <circle cx="400" cy="200" r="1" fill='red'/> <circle cx={x2} cy={y2} r='1' fill='red'/> <circle cx={x1} cy={y1} r='1' fill='red'/> </g> </svg> </div> ) } const AzimuthChart=(道具)=>{ 常数x1=428.9397 常数y1=159.2263 常数x2=371.3345 常数y2=159.0330 返回( ) }_Javascript_Reactjs_Svg - Fatal编程技术网

Javascript 如何填充圆中3个点之间的空间? 我必须指出一个圆的边界,在圆圈中间的点上。我想把这三个点之间的空间(饼图)涂成红色(包括“弧”)。它不必在svg中 const AzimuthChart = (props) => { const x1 = 428.9397 const y1 = 159.2263 const x2 = 371.3345 const y2 = 159.0330 return ( <div className="App"> <svg preserveAspectRatio="xMidYMin" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 400"> <g fill="#61DAFB"> <circle cx="400" cy="200" r="50"/> <circle cx="400" cy="200" r="1" fill='red'/> <circle cx={x2} cy={y2} r='1' fill='red'/> <circle cx={x1} cy={y1} r='1' fill='red'/> </g> </svg> </div> ) } const AzimuthChart=(道具)=>{ 常数x1=428.9397 常数y1=159.2263 常数x2=371.3345 常数y2=159.0330 返回( ) }

Javascript 如何填充圆中3个点之间的空间? 我必须指出一个圆的边界,在圆圈中间的点上。我想把这三个点之间的空间(饼图)涂成红色(包括“弧”)。它不必在svg中 const AzimuthChart = (props) => { const x1 = 428.9397 const y1 = 159.2263 const x2 = 371.3345 const y2 = 159.0330 return ( <div className="App"> <svg preserveAspectRatio="xMidYMin" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 400"> <g fill="#61DAFB"> <circle cx="400" cy="200" r="50"/> <circle cx="400" cy="200" r="1" fill='red'/> <circle cx={x2} cy={y2} r='1' fill='red'/> <circle cx={x1} cy={y1} r='1' fill='red'/> </g> </svg> </div> ) } const AzimuthChart=(道具)=>{ 常数x1=428.9397 常数y1=159.2263 常数x2=371.3345 常数y2=159.0330 返回( ) },javascript,reactjs,svg,Javascript,Reactjs,Svg,导出默认方位角曲线 这就是它现在的样子: 这就是我希望它看起来的样子: 我已尝试添加圆弧: <path d='M 449.89 203.252 A 1 1 0 0 0 350 202.8' fill='red'/> 但这只创造了半个圆圈。有人知道如何解决这些问题吗?你只要把这些点插到计算机上就行了。注意,由于需要“大”弧而不是“小”弧,因此需要将“大”弧标志设置为1 const x1=428.9397 常数y1=159.2263 常数x2=371.3345 常数y2=15

导出默认方位角曲线

这就是它现在的样子:

这就是我希望它看起来的样子:

我已尝试添加圆弧:

<path d='M 449.89 203.252 A 1 1 0 0 0 350 202.8' fill='red'/>


但这只创造了半个圆圈。有人知道如何解决这些问题吗?你只要把这些点插到计算机上就行了。注意,由于需要“大”弧而不是“小”弧,因此需要将“大”弧标志设置为1

const x1=428.9397
常数y1=159.2263
常数x2=371.3345
常数y2=159.0330
让路径=document.createElements('http://www.w3.org/2000/svg","路径",;
setAttribute(“d”,“M${x2}${y2}A 50 50 0 1 0${x1}${y1}L 400 200 Z`)
setAttribute(“填充”、“红色”);
document.getElementsByTagName('svg')[0].appendChild(路径)

假设您有
路径可以是
,即移动到中心400200,然后选择最大的圆弧绘制圆弧。最后你关闭了这条路