let data = [[0,0],[150,100],[210,100],[360,0]]
const cvs = document.querySelector('#myCanvas')
data = data.map(e=>{
return [e[0],e[1]===0 ? cvs.height : e[1]]
})
const ctx = cvs.getContext('2d')
ctx.beginPath()
ctx.moveTo(0,cvs.height)
for(let item of data){
ctx.lineTo(item[0],item[1])
}
ctx.strokeStyle = 'blue';
ctx.lineWidth = 2;
ctx.stroke()
<canvas id="myCanvas" width="500px" height="500px"></canvas>