react-native-chart
react-native-chart copied to clipboard
Fix wedge coordinate overwrites for Android
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
ios chart
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} />
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 Thanks for being so on top of this. Much appreciated!
Hi
I am also getting this issue. Have you got any solution for this?
@JagdishUpadhyay I have updated to 1.0.7-beta and Im still having the issue, anybody having any luck with this?
@boblad I am still looking for solution
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.
@boblad how do you make the donut shape for pie chart?
Hi,can I use react-native-chart for android project?It seem some behaviors different form ios,right?
Yes, you can. However this issue is still live on Android.
@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.
@tomauty Any clues as to what could be causing this?
Any news about this issue? I am having the same problem here on android, while on iOS the pie chart works nicely.
@jplethier @boblad have you got any solution??
Hi, any update on this?
I'm going to move our ART dependency to react-native-svg. Hopefully this resolves it...
Thanks for your answer, any approximate ETA for this transition? I know this must be a heavy rewrite, good luck for the implementation :-)
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
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 :-)
Hey, wondering if there's any update on this bug.
Thanks for making this library, It has been extremely helpful!
Other pie modules only have the same issue. Does it have any update?
I published a PieChart component works on both iOS and Android perfectly https://github.com/nihgwu/react-native-pie
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.