This draws a line from given co-ordinates Example usage: var newLine = new DiagonalLine({ x1: 0, y1: 0, x2: 200, y2: 200 }); $('#example').append(newLine.draw());