Skip to main content

PolyLine

A series of connected line segments. Unlike most label objects, PolyLine does not use a position anchor — coordinates are specified directly in the points array.

Mandatory properties

PropertyTypeDescription
typestringMust be PolyLine.
pointsarrayFlat array of coordinates: [x0, y0, x1, y1, ...]. Must contain at least 4 values (one segment).

Optional properties

PropertyTypeDescription
lineWidthnumberLine width. Default is 1.
colorstringLine color. May contain dynamic text. Default is black.
segmentsarrayDash pattern as alternating [dashLength, gapLength, ...] values. If omitted, a solid line is drawn.

Example

{
"type": "PolyLine",
"points": [10.0, 10.0, 50.0, 10.0, 50.0, 40.0],
"lineWidth": 1.0,
"color": "black"
}

Dashed line example:

{
"type": "PolyLine",
"points": [10.0, 20.0, 90.0, 20.0],
"lineWidth": 0.5,
"segments": [5.0, 2.0]
}