I'm trying to create a circular progress bar (although it will no longer be a bar, right?). Around this cricle there are thin rods perpendicular to the circle. Now the problem is that my code does not generate bars in a uniform interval. Here is the code and image of the result: 
function MH5PB(canvasId, //the id of the canvas to draw the pb on value, //a float value, representing the progress(ex: 0.3444) background, //the background color of the pb(ex: "#ffffff") circleBackground, //the background color of the bars in the circles integerColor, //the color of the outer circle(or the int circle) floatColor //the color of the inner circle(or the float circle) ) { var canvas = document.getElementById(canvasId); var context = canvas.getContext("2d"); var canvasWidth = canvas.width; var canvasHeight = canvas.height; var radius = Math.min(canvasWidth, canvasHeight) / 2; var numberOfBars = 72; var barThickness = 2;
EDIT: Oh, and the lines are not smoothing either. You know why? I must also explain that this progress bar has two parts. The outer circle (visible in the provided image) and the inner circle. The outer circle represents the sum of the integer part of the percentage (i.e. 45 to 45.98%), and the inner circle represents the sum of the non-integer part of the percentage (i.e. 98 to 45.98%). Therefore, now you know that intCircle and floatCircle :)
Milad.Nozari
source share