pguso/js-plugin-circliful

Circle percentage invalid scope declared (showing invalid graph value)

jochemmm opened this issue · 1 comments

While animate the circle (without multiple percentages), the graph is calculated with an undefined percentage variable. The variable percentage is not declared at the used scope.

Would you please fix the invalidly graph circle with the suggestion below? (bold marked)
We're using you're library for 520k+ users per year, so your help is very welcome. Thanks in advance.

Example calculation:
(40.27 / 385 ) * 100 = 0.1045974025974026
360 * 0.1045974025974026 = 37,65506493506494
(which currently results in 40, with animateStep = 8)

function animate() {
   var currentCircle = circle;
   var currentCalculateFill = calculateFill;

   if (settings.multiPercentage === 1) {
       var index, percent;
        ...
   } else {
        animateCircle(currentCircle, currentCalculateFill, 360, **settings.percent**);
   }
}

Errorneous circle before fix:
erroneous-circle-before-fix

Correct circle after fix:
correct-circle-after-fix

pguso commented

Thank you very much for the pull request!