I am having trouble describing the problem, but it says:
I am trying to create an SVG progress bar, and I found a great example of what I want to do without any third part libraries like snap:
http://codepen.io/JMChristensen/pen/Ablch
The problem is that I am having real problems with changing the origin of the strike. As you will notice, if you try this, the source will be on the right. I need him to appear from above.
Now I am a developer, so I tried myself, but I can’t let my life determine how to do it. If I change the stroke-dasharray attribute, the move will not match the percentage set in the stroke-dashoffset parameter.
I understand that it all comes down to mathematics with the assessment of a dashar strike, but I don’t quite understand what to do.
Dashoffset is calculated as follows:
var pct = ((100-val)/100)*(Math.PI*(r*2));
And there should be some correlation between this and the standard dasharray value of 565.48. Nothing is mentioned there.
source
share