Closed Demven closed 1 month ago
Hi @Demven How are you using react-native on web? Are you using expo or something else? If you have a ReactJS project, you can use the react-gifted-charts library for charts.
@Abhinandan-Kushwaha Yes, I use Expo.
@Abhinandan-Kushwaha I'm trying to bypass this limitation by moving the interactivity out of the chart, so that you can select chart segments from the list of categories on the left. Then I pass data
prop to the PieChart with focused: true/false
.
However, each segment when focused has the same color (url(#grad0)
which is red), it's the reference to the color of the first segment, if you inspect it in the DevTools. Ignore the pie chart at the top, it's my own implementation, which is interactive, but has some problems that I don't know how to solve, so I'd like to switch to your library.
See the demo:
https://github.com/user-attachments/assets/58788c63-4667-4ebc-a922-8151d4e6cdc9
Is this a bug? Any way to make the focused segment to maintain the original segment color?
Thank you very much for all your help and work in maintaining this library.
Best, Dmitry
Hi @Demven The issue is with the react-native-svg library which does not allow onPress
events on web. See https://github.com/software-mansion/react-native-svg/issues/1483
Your workaround should work correctly from versions 1.4.31
onwards. Please use the latest version of the library.
Thank you!
@Abhinandan-Kushwaha I upgraded to v 1.4.36
, and both focusOnPress
and sectionAutoFocus
still do not work for me. Should I have just upgraded to 1.4.31+
or also do something else on my side?
I'm building a React Native app for iOS and Web platforms, and the PieChart doesn't support interactivity in Web. I'm using your example:
However, the
onPress
event is not supported in browsers. You must useonClick
internally as the fallback. Or maybe the problem is caused by smth else. Can you fix this?I love your library, it's really great. But I can't make it interactive for Web. Please help.