Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
Canvas and arc drawing doesnt work properly in html and javascript

So I have this Canvas on which I have my circle and when I try to change the x and y of my circle it glitches.It appears like this when I try to move it towards the left by changing the x value to 10 changing the x to any other value makes no change: When I change arc's x value to 10 or below

When I change y to more than 110:

When I change arc's y value to 110 or above

HTML:

<span id="span_canvas">
<canvas id ="MyCanvas" style="padding-left: 1215px;padding-bottom: 415px;margin: 
0px;border:ridge rgb(127, 117, 117);"></canvas>
</span>

Javascript:

function Circle(radius ,fillcolor){
    let canvas=document.getElementById("MyCanvas");
    let ctx= canvas.getContext("2d");
    ctx.beginPath();
    ctx.arc(100, 110, 50, 0, 2 * Math.PI);
    ctx.strokeStyle="#c3c3c3";
    ctx.fillStyle=fillcolor
    ctx.stroke()
    ctx.fill();
    fillcolor=red
}
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Remove padding-left: 1215px;padding-bottom: 415px; and see what is going on. The area where the circle appears to be cut out is padding area. In other words, the position of the circle is outside the content area.

about 4 years ago · Juan Pablo Isaza Report

0

You need to Include Height an Width Tags to xour canvas

<canvas id ="canvas" height="200px" style="padding-left: 1215px;padding-bottom: 415px;margin: 
0px;border:ridge rgb(127, 117, 117);"></canvas>

Then it will work.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!