andreaferretti / paths-js

Generate SVG paths for geometric shapes :bar_chart:
http://andreaferretti.github.io/paths-js-react-demo/
Apache License 2.0
1.71k stars 84 forks source link

Prevent Crashes on Pie Charts #56

Closed paulomoreno closed 5 years ago

paulomoreno commented 5 years ago

A small fix I made while working on a personal project using react-native-chart-kit. Currently, when I have a Pie chart with empty data values, the chart crashes. My fix is to default the sum to 1 in that case, so there's no 0 division, while the chart will remain empty. I tried to write a test case for this, but I'm not sure if it makes sense.

I hope this helps!

andreaferretti commented 5 years ago

Thank you!