I want to build an analog clock using a canvas. The first step is to draw a circle but for some reason the circle is not being correctly drawn. The circle is not complete. This is what I'm trying to do:
var canvas = document.createElement("canvas");
canvas.style.height = "250px";
canvas.style.width = "250px";
var ctx = canvas.getContext("2d");
ctx.beginPath();
ctx.arc(125, 125, 70, 0, 2 * Math.PI);
ctx.stroke()
ctx.closePath();
window["clock"].appendChild(canvas);
#clock{
width: 250PX;
height: 250px;
border: 1px solid gray;
}
<div id="clock">
</div>
I am trying really hard to understand why the circle is not being drawn properly. I need this to be dynamic though. How can I make this work?