Created
December 28, 2020 17:03
-
-
Save tomshaw/f995c43003548255234819517fc93cb1 to your computer and use it in GitHub Desktop.
Set svg circle circumference stroke.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.$svgCircle = document.querySelector("circle"); | |
this.circumference = 2 * Math.PI * this.$svgCircle.getAttribute("r"); | |
setCircleProgress(amount) { | |
let res = amount * this.circumference / 100 + ", " + this.circumference; | |
this.$svgCircle.setAttribute("stroke-dasharray", res) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment