Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> </head> <body> <canvas id="canvas" width="300" height="100"></canvas> <script> var canvas=document.getElementById('canvas'); var context=canvas.getContext('2d'); var centerX=canvas.width / 2; var centerY=canvas.height / 2; var radius=40; context.beginPath(); context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false); context.fillStyle='lightgreen'; context.fill(); context.lineWidth=2; context.strokeStyle="green"; context.stroke(); </script> </body> </html>