Skip to content

Drawing Polylines

A polyline is a series of connected line segments.

TIP

To draw simple lines or line segments, use the Line component.

Props

NameTypeDefaultDescription
pointsPossibleVector2[]noneThe points of the polyline.
line-widthnumber1.75The width of the polyline.
colorstring#000The stroke color of the polyline.
dashedbooleanfalseWhether the polyline should be dashed.

Examples

Simple Polyline

-5-4-3-2-1012345543210-1-2-3-4-5
Code
vue
<template>
  <Graph>
    <PolyLine
      :points="[
        [0, 0],
        [1, 1],
        [2, 0],
        [3, 1],
        [4, 0],
      ]"
    />
  </Graph>
</template>