.. simple canvas CODE
Click on the function startCanvas() to init the canvas...
Click on the function lines() to draw some lines...
Click on the function rect() to draw some rectangles...
<canvas width="600" height="200" class="gray" id="can">
</canvas>
var ctx;
function startCanvas()
{
var draw = document.getElementById("can");
ctx = draw.getContext("2d");
}
function lines()
{
ctx.lineWidth = 4.0;
ctx.strokeStyle = "#000000";
ctx.beginPath();
ctx.moveTo(0,0);
ctx.lineTo(150,100);
ctx.lineTo(300,40);
ctx.lineTo(400,125);
ctx.lineTo(550,100);
ctx.moveTo(300,10);
ctx.lineTo(300,190);
ctx.stroke();
}
function rect()
{
ctx.fillStyle="#00eedd";
ctx.fillRect(50,50,50,30);
ctx.fillRect(150,50,80,30);
ctx.fillRect(350,150,50,90);
}