Code
Execute
<!DOCTYPE html> <html> <body> <canvas id="myCanvas" width="300" height="150" style="border:1px solid blue;"> </canvas> <script> var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.beginPath(); ctx.moveTo(20, 20); ctx.lineTo(100, 20); ctx.arcTo(150, 20, 150, 70, 50); ctx.lineTo(150, 120); ctx.stroke(); </script> </body> </html>
Result