genexu / react-native-pie-chart

Simple pie chart module for your React Native app
MIT License
111 stars 48 forks source link

Error in rendering pie chart (angle greater than 360) #33

Closed acapellacci closed 1 year ago

acapellacci commented 2 years ago

With this series

[789669, 530000, 40149, 3236, 16358, 26]

in index.tsx, the expression

previous[previous.length - 1] + Math.round((360 * current) / sum)

returns an angle greater than 360.

Math.round should be changed in Math.floor

aidin36 commented 2 years ago

Thanks for catching this @acapellacci . Are you keen to send a PR? To keep the credit? Otherwise, I can fix it myself.

acapellacci commented 2 years ago

Thanks for catching this @acapellacci . Are you keen to send a PR? To keep the credit? Otherwise, I can fix it myself.

@aidin36 Fix it yourself, please.

andordavoti commented 2 years ago

can you submit a new release with this fix? also ran into this issue, this commit seems to solve my case

acapellacci commented 2 years ago

can you submit a new release with this fix? also ran into this issue, this commit seems to solve my case

unfortunately I do not have writing privileges. The owner should do that.

aidin36 commented 1 year ago

Sorry for the long delay. It's now published in 2.1.0 version.