<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
canvas{background: #b8edc9;}
</style>
</head>
<body>
<h5>Canvas</h5>
<canvas id="mycanvas" width="1000" height="1000">
您的浏览器不支持html5dcanvas元素
</canvas>
<script type="text/javascript">
var canvas=document.getElementById('mycanvas');//定义变量获取画布dom
var c=mycanvas.getContext('2d');//设置绘图环境2d
c.lineWidth=4;//设置线宽
c.strokeStyle="#A52A2A";//设置边颜色
//绘制圆
c.fillStyle="gold";
c.arc(50,350,30,0,Math.PI*2)//Math.PI*2表示角度
c.stroke();
//绘制实心
c.beginPath();
c.arc(50,430,30,0,Math.PI*2)//
c.fill()
//绘制有边的实心圆
c.beginPath();
c.lineWidth=3;
c.strokeStyle="darkblue";
c.fillStyle="gold";
// c.arc(50,260,30,0,Math.PI*2)
// c.stroke();
// c.beginPath();
// c.arc(50,260,30,0,Math.PI*2)
// c.fill()
c.beginPath();
c.arc(50,260,30,0,Math.PI*2)
c.stroke();
c.fill()
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
canvas{background: #b8edc9;}
</style>
</head>
<body>
<h5>Canvas</h5>
<canvas id="mycanvas" width="1000" height="1000">
您的浏览器不支持html5dcanvas元素
</canvas>
<script type="text/javascript">
var canvas=document.getElementById('mycanvas');//定义变量获取画布dom
var c=mycanvas.getContext('2d');//设置绘图环境2d
c.lineWidth=4;//设置线宽
c.strokeStyle="#A52A2A";//设置边颜色
//绘制圆
c.fillStyle="gold";
c.arc(50,350,30,0,Math.PI*2)//Math.PI*2表示角度
c.stroke();
//绘制实心
c.beginPath();
c.arc(50,430,30,0,Math.PI*2)//
c.fill()
//绘制有边的实心圆
c.beginPath();
c.lineWidth=3;
c.strokeStyle="darkblue";
c.fillStyle="gold";
// c.arc(50,260,30,0,Math.PI*2)
// c.stroke();
// c.beginPath();
// c.arc(50,260,30,0,Math.PI*2)
// c.fill()
c.beginPath();
c.arc(50,260,30,0,Math.PI*2)
c.stroke();
c.fill()