Skip to main content

PolyLine

A series of connected line segments, optionally filled. 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. If fillColor is set, a line width of 0 draws no outline.
colorstringLine color. May contain dynamic text. Default is black.
fillColorstringFill color. May contain dynamic text. If omitted, the polyline is not filled. v5.4
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]
}

Filling​

If fillColor is set, the area enclosed by the points is filled, as if the last point was connected back to the first. The outline is drawn on top of the fill, exactly as given by points, so it is only closed if the last point repeats the first. Where the outline crosses itself, the fill uses the even-odd rule, so for example the center of a five-pointed star drawn with crossing lines is not filled.

Filled triangle without an outline v5.4:

{
"type": "PolyLine",
"points": [10.0, 40.0, 30.0, 10.0, 50.0, 40.0],
"lineWidth": 0,
"fillColor": "black"
}