Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not work if values are 100 & 0 #39

Open
abchauh opened this issue Mar 7, 2016 · 2 comments
Open

does not work if values are 100 & 0 #39

abchauh opened this issue Mar 7, 2016 · 2 comments

Comments

@abchauh
Copy link

abchauh commented Mar 7, 2016

Hi,

How do I make it work if values are 100 & 0% - it does not display the full circle for 100.
It works brilliantly of it's 99 & 1%

Please suggest if this is made to work for 100%

Thanks

@tagya
Copy link

tagya commented Nov 28, 2017

same like me i am also in trouble in that case.
Please assist .!

@avetisyan
Copy link

avetisyan commented Nov 30, 2017

On line 735 of pizza.js, there's for loop. Just add a check if the value is equal to total sum, and subtract some small angle so that start and end do not match. You can update the loop like this:

for (var i = 0; i < data.length; i++) {
      angles[i] = data[i].value / total * Math.PI * 2;

      if(data[i].value == total) angles[i] = Math.PI * 2 - 0.0001; // if this one takes 100%, e.g the rest is zero or it is the only one
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants