Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在画布元素上制作一种饼图形状,但是我似乎找不到任何可以自行执行此操作的函数。我似乎只能画出完整的圆圈和线段。是否有捷径可寻?
(另见:关于圈子术语的维基百科)
以下应该有效:
context.moveTo(cx,cy); context.arc(cx,cy,radius,startangle,endangle); context.lineTo(cx,cy); context.stroke(); // or context.fill()
其中cx,cy为圆弧的中心。
cx
cy