react-native-chart icon indicating copy to clipboard operation
react-native-chart copied to clipboard

Android vs iOS chart pie

Open ErrorPro opened this issue 9 years ago • 8 comments

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 avatar Aug 14 '16 00:08 ErrorPro

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.

ErrorPro avatar Aug 14 '16 14:08 ErrorPro

I'm having the same issue as well.

daikini avatar Aug 24 '16 10:08 daikini

@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"```

ErrorPro avatar Aug 24 '16 12:08 ErrorPro

I'm having the same issue

dalmeria avatar Aug 31 '16 16:08 dalmeria

Any updates on this?

zackify avatar Sep 22 '16 19:09 zackify

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

RedFu01 avatar Sep 22 '16 19:09 RedFu01

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

brunobraga95 avatar Oct 21 '16 20:10 brunobraga95

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.

tomauty avatar Jul 07 '17 20:07 tomauty