I want to get interactive charts to work in my React Native app. I know there's probably not a React Native specific library made yet, but what Objective-C/Swift/Javascript library should I be looking into that would allow me to make charts/graphs that look like the ones Chart.js generate?
react-chartist is written for the browser, so not compatible with react-native (I didn't try but should work in a webview).
React Native is an entire platform allowing you to build native, cross-platform mobile apps, and React. js is a JavaScript library you use for constructing a high performing UI layer. React. js is the heart of React Native, and it embodies all React's principles and syntax, so the learning curve is easy.
There are several npm packages that allow charts to be created in React; chart. js is one of the packages which makes the creation of charts and graphs very easy. The React wrapper for chart.
I would go for ART library of the react-native project.
Here is a chart example for ReactJS that you could adapt for react-native, by looking at these React-native Art examples.
Also, there is probably something to investigate with Chartist library which use SVG to draw charts, and that has a reactjs component.
EDIT: As of version 0.18rc, React-Native also support ART library for Android.
You'll be wanting to look at Obj-C and Swift, not JavaScript I think. Existing JS libraries will be drawing to the DOM, Canvas or some other browser target that won't be available in React Native. That should narrow the field a bit. Then to use it direct from RN you need to create a Native Module between JS and Obj-C.
So at that point it boils down to: "what's a good iOS charting library" and fortunately someone's already done the hard work on that one over on this answer. Core Plot looks pretty comprehensive.
https://github.com/tomauty/react-native-chart has been available for a while.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With