Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chart.js equivalent for React Native [closed]

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?

like image 980
millionhari Avatar asked Apr 04 '15 02:04

millionhari


People also ask

Can I use chart JS With React Native?

react-chartist is written for the browser, so not compatible with react-native (I didn't try but should work in a webview).

Is React Native close to react js?

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.

Can I use Chartjs With react?

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.


3 Answers

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.

like image 179
Sulliwane Avatar answered Oct 06 '22 11:10

Sulliwane


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.

like image 31
Colin Ramsay Avatar answered Oct 06 '22 09:10

Colin Ramsay


https://github.com/tomauty/react-native-chart has been available for a while.

like image 40
vinayr Avatar answered Oct 06 '22 10:10

vinayr