linePath

Chart
stable

Converts an array of pre-scaled [x, y] pixel coordinates into an SVG path string using straight line segments (M…L…). Returns an empty string for an empty array.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

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

points
requis
Array<TPathPoint>
Array of pre-scaled SVG pixel coordinate pairs [x, y]. The first point becomes the M command; subsequent points become L commands.

API

Valeur de retour

La valeur retournée par cet util.

SVG path d attribute string (e.g. "M0,0 L10,10 L20,5"). Empty string when points is empty.

Usage

Exemples

Extraits de code prêts à coller.

Build a straight-line SVG path

typescript