function drawFigure() { var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); ctx.beginPath(); ctx.moveTo(10, 10); ctx.lineTo(10, 300); ctx.stroke(); ctx.closePath(); ctx.beginPath(); ctx.moveTo(5, 295); ctx.lineTo(305, 295); ctx.stroke(); ctx.closePath(); ctx.fillStyle = "rgb(210,0,0)"; ctx.fillRect (25, 131.31946174931, 25, 163.68053825069); ctx.fillStyle = "rgb(210,0,0)"; ctx.fillRect (60, 281.4864191378, 25, 13.513580862198); ctx.fillStyle = "rgb(210,0,0)"; ctx.fillRect (95, 248.31672065786, 25, 46.683279342138); ctx.fillStyle = "rgb(210,0,0)"; ctx.fillRect (130, 254.82058310491, 25, 40.179416895091); ctx.fillStyle = "rgb(210,0,0)"; ctx.fillRect (165, 274.11537503115, 25, 20.884624968851); ctx.fillStyle = "rgb(210,0,0)"; ctx.fillRect (200, 289.94144031896, 25, 5.0585596810366); }