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.

typescript

API

Parameters

Input parameters accepted by this util.

cx
required
number
X coordinate of the chart center.
cy
required
number
Y coordinate of the chart center.
outerR
required
number
Outer radius of the arc (pie radius).
innerR
required
number
Inner radius. Pass 0 for a solid pie slice, or a positive value for a donut hole.
startAngle
required
number
Start angle in radians (math convention, 0 = 3 o'clock, CCW).
endAngle
required
number
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

typescript