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

Fix wedge coordinate overwrites for Android

Open boblad opened this issue 8 years ago • 22 comments

My last Color is dominating the pie chart, The last color, in this case green is overriding the rest of the colors, Am i doing something wrong?

this is my android chart screen shot 2016-06-20 at 2 40 03 pm

ios chart screen shot 2016-06-20 at 2 39 55 pm

const data = [
  [0, 1],
  [0, 1],
  [0, 1],
  [0, 1]
]
...
  <Chart
          style={styles.chart}
          type="pie"
          data={data}
          sliceColors={['blue', 'yellow', 'red', 'green' ]}
          showAxis={false} />

boblad avatar Jun 20 '16 20:06 boblad

I should have a fix for android pie charts pushed tomorrow. I'm aware there is an issue with them at the moment :(

Tom

On Mon, Jun 20, 2016 at 4:43 PM, Bryant O. [email protected] wrote:

My last Color is dominating the pie chart, The last color, in this case green is overriding the rest colors, Am i doing something wrong?

this is my android chart [image: screen shot 2016-06-20 at 2 40 03 pm] https://cloud.githubusercontent.com/assets/11641048/16209659/477ae7ba-36f5-11e6-9215-6cb7ffe6720e.png

ios chart [image: screen shot 2016-06-20 at 2 39 55 pm] https://cloud.githubusercontent.com/assets/11641048/16209668/550484fe-36f5-11e6-85c4-453c44febebe.png

const data = [ [0, 1], [0, 1], [0, 1], [0, 1] ] ... <Chart style={styles.chart} type="pie" data={data} sliceColors={['blue', 'yellow', 'red', 'green' ]} showAxis={false} />

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tomauty/react-native-chart/issues/85, or mute the thread https://github.com/notifications/unsubscribe/ABD7KLvDGkOJaLR_2fcpz54B7m5a7VPxks5qNvuCgaJpZM4I6Guf .

tomauty avatar Jun 20 '16 20:06 tomauty

@tomauty Thanks for being so on top of this. Much appreciated!

boblad avatar Jun 20 '16 20:06 boblad

Hi

I am also getting this issue. Have you got any solution for this?

JagdishUpadhyay avatar Jul 14 '16 10:07 JagdishUpadhyay

@JagdishUpadhyay I have updated to 1.0.7-beta and Im still having the issue, anybody having any luck with this?

boblad avatar Jul 22 '16 14:07 boblad

@boblad I am still looking for solution

JagdishUpadhyay avatar Jul 22 '16 17:07 JagdishUpadhyay

Hi, looking into this still. I'm going to see if wedge drawing is fixed in a newer RN version, and what they might've merged to make it work properly.

tomauty avatar Jul 27 '16 01:07 tomauty

@boblad how do you make the donut shape for pie chart?

doddys avatar Jul 27 '16 05:07 doddys

Hi,can I use react-native-chart for android project?It seem some behaviors different form ios,right?

liukepeng avatar Jul 27 '16 08:07 liukepeng

Yes, you can. However this issue is still live on Android.

tomauty avatar Jul 27 '16 13:07 tomauty

@doddys I do a position absolute child view with a background color of white, (in this example), here's some sudo code so you get the idea. fill in variables as you would like.


const chartStyle = {
   width: chartWidth,
   height: chartWidth,
   justifyContent: 'center',
   alignItems:'center'
};

const centerStyle = {
      width: chartWidth - chartThickness,
      height: chartWidth - chartThickness,
      borderRadius: ((chartWidth - chartThickness) / 2),
      backgroundColor: WHITE,
      position: 'absolute',
      top: (chartWidth / 2) - ((chartWidth - chartThickness) / 2),
      left: (chartWidth / 2) - ((chartWidth - chartThickness)/ 2),
      justifyContent: 'center',
      alignItems: 'center'
}

<View style={chartStyle}>
    <Chart
          style={chartStyle}
          type="pie"
          data={some data}
          sliceColors={[list, of, colors]}
          showAxis={false} />
    <View  style={centerStyle}/>
</View>

this is the basic idea, Im sure there are better implementations and i might not need all of the style properties but this was my approach. Hope this helps.

boblad avatar Jul 27 '16 15:07 boblad

@tomauty Any clues as to what could be causing this?

boblad avatar Jul 27 '16 22:07 boblad

Any news about this issue? I am having the same problem here on android, while on iOS the pie chart works nicely.

jplethier avatar Aug 04 '16 19:08 jplethier

@jplethier @boblad have you got any solution??

JagdishUpadhyay avatar Aug 06 '16 18:08 JagdishUpadhyay

Hi, any update on this?

mlumbroso avatar Aug 20 '16 22:08 mlumbroso

I'm going to move our ART dependency to react-native-svg. Hopefully this resolves it...

tomauty avatar Aug 24 '16 20:08 tomauty

Thanks for your answer, any approximate ETA for this transition? I know this must be a heavy rewrite, good luck for the implementation :-)

mlumbroso avatar Aug 28 '16 11:08 mlumbroso

No update yet. Probably next week. Line charts on svg are mostly done. Bar, pie, and multi line are scheduled for next week. Apologies for holding this lib up for so long. Turns out ART primitives are a bit lacking for a project of this scope.

On Sunday, August 28, 2016, Michael Lumbroso [email protected] wrote:

Thanks for your answer, any approximate ETA for this transition? I know this must be a heavy rewrite, good luck for the implementation :-)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tomauty/react-native-chart/issues/85#issuecomment-242969214, or mute the thread https://github.com/notifications/unsubscribe-auth/ABD7KNE5HYpvUsoHeP4Qi8khjDu2X4kpks5qkW39gaJpZM4I6Guf .

Tom

tomauty avatar Aug 28 '16 17:08 tomauty

Hi @tomauty

I couldn't figure out from the commits if you managed to solve the issue. Anything I can do to help you? Some testing or investigation?

Thanks for your great work :-)

mlumbroso avatar Sep 20 '16 15:09 mlumbroso

Hey, wondering if there's any update on this bug.

Thanks for making this library, It has been extremely helpful!

kenny221 avatar Oct 24 '16 22:10 kenny221

Other pie modules only have the same issue. Does it have any update?

tiaaaa123 avatar Feb 07 '17 15:02 tiaaaa123

I published a PieChart component works on both iOS and Android perfectly https://github.com/nihgwu/react-native-pie

nihgwu avatar Feb 23 '17 14:02 nihgwu

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