tomauty / react-native-chart

[NOT MAINTAINED] :bar_chart: Add line, area, pie, and bar charts to your React Native app
http://tomauty.github.io/react-native-chart
MIT License
1.57k stars 240 forks source link

Android vs iOS chart pie #118

Open ErrorPro opened 7 years ago

ErrorPro commented 7 years ago

Hello. I have a problem with pie chart. Here is the data i have [ [ 0, 128 ], [ 128, 42 ], [ 42, 17 ], [ 17, 16 ] ] and here is the result i have https://monosnap.com/file/lZyY0b4hOvtwSsmwBFTPMl1Ie3riaF

left screen is iOS, right screen is Android

package.json is :

 "react": "~15.2.1",
 "react-native": "^0.31.0",

Can anybody tell me what am i doing wrong?

ErrorPro commented 7 years ago

Same for a bar chart. here is the data [['first', 122], ['second', 44], ['third', 17], ['fourth', 16]] here what i got https://monosnap.com/file/vYb2xje6irIWK68KyMaMN2Brrjlr4x

the third bar's height is wrong.

daikini commented 7 years ago

I'm having the same issue as well.

ErrorPro commented 7 years ago

@daikini for bar chart i found only one way how to fix that issue. But it still looks weird.

          data={preparedData}
          verticalGridStep={1}
          color={'black'}
          type="bar"```
dalmeria commented 7 years ago

I'm having the same issue

zackify commented 7 years ago

Any updates on this?

RedFu01 commented 7 years ago

The pie chart error originates from a bug in the react native art implementstion on android. Basicly there is a problem when you want to draw wedges which cover more than 180 degrees. as a quick fix try to replace every dataset with three copies of the dataset. So that instead of one wedge it will draw three wedges with a third of the area and give them all the same color

brunobraga95 commented 7 years ago

Anybody know how to fix the pie problem? here it always uses the same color.

tomauty commented 7 years ago

As a generic FYI — I am no longer able to maintain this library. I recommend checking out victory-native as it's much more maintained.