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

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

cx
requis
number
X coordinate of the chart center.
cy
requis
number
Y coordinate of the chart center.
outerR
requis
number
Outer radius of the arc (pie radius).
innerR
requis
number
Inner radius. Pass 0 for a solid pie slice, or a positive value for a donut hole.
startAngle
requis
number
Start angle in radians (math convention, 0 = 3 o'clock, CCW).
endAngle
requis
number
End angle in radians (math convention). Returns an empty string when the sweep is zero.

API

Valeur de retour

La valeur retournée par cet util.

SVG path data string. Returns an empty string when the angular sweep is effectively zero.

Usage

Exemples

Extraits de code prêts à coller.

Full-circle donut slice

typescript