Note
This version is only for the android
Installation
npm install --save react-native-graphviewreact-native link react-native-graphview
Android
- Add the following in android/settings.gradle:
include ':react-native-graphview'project(':react-native-graphview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-graphview/android/app')
- Update MainApplication.java
- Update build.gradle.java
dependencies { implementation project(':react-native-graphview') }
Properties
Props | Description |
---|---|
data | same props to all graph types |
Example
import React Component from 'react';import StyleSheet Text View from 'react-native';import LineGraph BarGraph PointsGraph from 'react-native-graphview'; const data = x: 0 y: 1 x: 1 y: 5 x: 2 y: 9 x: 3 y: 2 x: 4 y: 6; { return <View => <LineGraph = = /> <BarGraph = = /> <PointsGraph = = /> </View> ; } const styles = StyleSheet;