Link to home
Start Free TrialLog in
Avatar of nav2567
nav2567Flag for United States of America

asked on

HTML Canvas question.

Hello,

I need to draw 5 circles within this photoshop canvas.  For some reason, the first circle is only showing half of it.  Please advise how to fix it.  Thanks.

<!DOCTYPE html>
<html>
<head>
   <title></title>
</head>
<body onload="draw()">

   <canvas id="sketch" width="300" height="300">

   </canvas>

   <script>
      function draw() {
          var sketch = document.getElementById('sketch');
         var context = sketch.getContext("2d");

         context.fillStyle = "#FF0000 ";
           
         for (i=0; i<=4; i++){
         context.beginPath();
         context.arc((i*70),20, 10, 0, 2 * Math.PI, true);
         context.closePath();
         context.fill();
}
}


   </script>

</body>
</html>
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial