genexu / react-native-pie-chart

Simple pie chart module for your React Native app
MIT License
109 stars 47 forks source link

Pie chart not rendering properly for a single value #8

Closed Zalarox closed 7 years ago

Zalarox commented 7 years ago

Hey,

So I was trying to use the chart for a single value like so: const series = [1];

And instead of drawing a circle it messes it up as shown: Issue

What I'm trying to accomplish is a dynamic pie chart with three values in the series, so if one of them is say 0, that is const series = [0, 25, 52];

It should just render the pie chart with two values. Is there a better way to accomplish that? Because passing 1 value in causes that issue.

Thanks!

edit: Forgot to mention I'm testing on an Android device.

genexu commented 7 years ago

Hello @Zalarox, thanks for reporting! this really helpful :).

Follow you description, i just release new version to fix single value drawing issue on android, in addition, add precaution for 0 value in array.

You can update package version and try again, welcome any feedback.