1.Canvas画圆
context.arc(x, y, radius, startAngle, endAngle, anticlockwise)
参数 x,y表示圆心
radius半径
startAngle起始弧度
endAngle终止弧度
anticlockwise是否为逆时针方向
<script type="text/javascript"> function drawScreen() { var h = 180; var x = document.getElementById("myCanvas"); context = x.getContext("2d"); context.beginPath(); context.fillStyle = "#eeeeee"; context.strokeStyle = "#000000"; context.lineWidth = 1.414; context.arc(2 * h, 2 * h, h - 3, 0.11, Math.PI - 0.11, true); context.fill(); context.stroke(); context.closePath(); } window.addEventListener("load", drawScreen, false) </script> <h2> Arc</h2> <canvas id="myCanvas" width="600" height="600">你的浏览器还不支持哦</canvas>