Draws a grid in your html5 canvas - See demo
Get a reference to the JavaScript file in the page head:
<scripttype="text/javascript" src="dist/grid.js"></script>Assume that we have a HTML5 canvas element:
<canvasid="myCanvas" width="350" height="200"></canvas>Use grid in JavaScript code like this when you want to pass your own options:
varcanvas=document.getElementById("myCanvas");varcontext=canvas.getContext("2d");varopts={distance : 20,lineWidth : 1.5,gridColor : "green",caption : true};newGrid(opts).draw(context);or like this without options:
varcanvas=document.getElementById("myCanvas");varcontext=canvas.getContext("2d");newGrid().draw(context);Have a look at the Demo page here