Hi,
I'm new to javascript.I want to draw line,circle using JavaScript vector-draw library.Following is my coding,but it doesn't work.Please help me to improve that....
[HTML]<html>
<body>
<script type="text/javascript" src="wz_jsgraphics.js"></script>
<div id="myCanvas" style="position:relative;height:250px;width:100%;" ></div>
<div id="anotherCanvas" style="position:relative;height:100px;width:300px; "></div>
function myDrawFunction()
{
jg_doc.setColor("#00ff00");
jg_doc.fillEllipse(100, 200, 100, 180);
jg_doc.setColor("maroon");
jg_doc.drawPolyline(new Array(50, 10, 120), new Array(10, 50, 70));
jg_doc.paint();
jg.setColor("#ff0000");
jg.drawLine(10, 113, 220, 55);
jg.setColor("#0000ff");
jg.fillRect(110, 120, 30, 60);
jg.paint();
jg2.setColor("#0000ff");
jg2.drawEllipse(10, 50, 30, 100);
jg2.drawRect(400, 10, 100, 50);
jg2.paint();
jg.drawLine(20,50,453,40);
}
var jg_doc = new jsGraphics();
var jg = new jsGraphics("myCanvas");
var jg2 = new jsGraphics("anotherCanvas");
myDrawFunction();
//-->
</script>
</body>
</html>[/HTML]