# CanvasContext.setLineDash(Array.&ltnumber&gt pattern, number offset)

Start from base library version 1.6.0. Please remaining backward compatible.

From base library 1.9.90 Start, this interface stops maintenance, please use CanvasContext.lineDashOffset replace

with Promise style call: Not supported

Mini Program plugin: Support

Sets the dashed line style.

# parameter

# Array.&ltnumber&gt pattern

A set of numbers describing the length of interchangeably drawn line segments and spacing (in coordinate space units)

# number offset

Dotted line offset

# sample code

const ctx = wx.createCanvasContext('myCanvas')

ctx.setLineDash([10, 20], 5)

ctx.beginPath()
ctx.moveTo(0,100)
ctx.lineTo(400, 100)
ctx.stroke()

ctx.draw()