解决方法
您需要使用以下liabrary:
将代码放在头标中.
<script type="text/JavaScript" src="jsDraw2D.js"></script>
可从here下载
将以下代码复制并粘贴到希望您的圈子出现的位置…
<script type="text/JavaScript"> //Create jsGraphics object var gr = new jsGraphics(document.getElementById("canvas")); //Create jsColor object var col = new jsColor("red"); //Create jsPen object var pen = new jsPen(col,1); //Draw a Line between 2 points var pt1 = new jsPoint(20,30); var pt2 = new jsPoint(120,230); gr.drawLine(pen,pt1,pt2); //Draw filled circle with pt1 as center point and radius 30. gr.fillCircle(col,30); //You can also code with inline object instantiation like below gr.drawLine(pen,new jsPoint(40,10),new jsPoint(70,150)); </script>
您可以从here查看文档