polygonPath

Chart
stable

Convert an array of [x, y] chart coordinates into a closed SVG path string (M…L…Z). Returns an empty string when the array is empty.

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 [x, y] coordinate pairs in chart (pixel) space. Must contain at least one entry; an empty array yields an empty string.

API

Valeur de retour

La valeur retournée par cet util.

A closed SVG path `d` string (M…L…Z) suitable for a `<polygon>` fill, or an empty string when points is empty.

Usage

Exemples

Extraits de code prêts à coller.

Build a closed triangle path

typescript