arcPath
Chart
stable
Build an SVG path string for a pie or donut slice. Angles are in radians using the standard math convention (0 at 3 o'clock, counter-clockwise); the helper converts internally to the SVG convention.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- cxrequirednumber
- X coordinate of the chart center.
- cyrequirednumber
- Y coordinate of the chart center.
- outerRrequirednumber
- Outer radius of the arc (pie radius).
- innerRrequirednumber
- Inner radius. Pass 0 for a solid pie slice, or a positive value for a donut hole.
- startAnglerequirednumber
- Start angle in radians (math convention, 0 = 3 o'clock, CCW).
- endAnglerequirednumber
- End angle in radians (math convention). Returns an empty string when the sweep is zero.
API
Return value
The value returned by this util.
- SVG path data string. Returns an empty string when the angular sweep is effectively zero.
Usage
Examples
Ready-to-paste usage snippets.
Full-circle donut slice