View Full Version : How to draw a line ??

10-28-2004, 08:25 AM
How to draw a line from a pt. to another pt. by javascript?
Any idea for that?

function drawLine(x1, y1, x2, y2) {

10-28-2004, 09:54 AM
can't be done; javascript's only graphic capability is displaying graphic files, like jpegs, gifs, etc. you could plot a number of points between areas, and display an image at each of the points, but that's about it.

10-28-2004, 10:27 AM
check out SVG. that can do wot you want. :p

you could always google to see. try the keywords: "javascript draw lines"

i did, and look wot i found (http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm) - funny that, eh?! :rolleyes:

btw: Walter's library is very cool, but it's also very slow to render. not ideal for websites. SVG would still be best: you can code that via JS too. :D

10-28-2004, 10:29 AM
can't be done;

I would'nt not be so sure... :cool:

Take a look at:

And about SGV