Type of Graph using React Native Chart Kit

GEITPL
2 min readMay 19, 2021

--

React Native Chart Kit

This is an example to create Different Type of Graph using React Native Chart Kit for Android and IOS. Charts/Graphs are the easiest and efficient way to showcase any data. With the help of the chart/graph, One can easily see the numeric data or the statics. The understanding of the statics using the Chart/Graph makes it more demanding for any application. You have generally seen charts in the accounting apps like expense sharing. If you are planning to make your own app that needs to create the Chart/Graph then here is the example for you.

  1. StackedBar Chart
  2. Pie Chart
  3. Contribution Chart

To Make a React Native App

npm install -g react-native-cli

Run the following commands to create a new React Native project

react-native init ProjectName

Installation of Dependencies

To install these open the terminal and jump into your project using

cd ProjectName

Run the following command to install

npm install react-native-chart-kit --savenpm install react-native-svg --save

CocoaPods Installation

After the updation of React Native 0.60, they have introduced autolinking so we do not require to link the library but need to install pods. So to install pods use

cd ios && pod install && cd ..

Code

To Run the React Native App

Open the terminal again and jump into your project using.

cd ProjectName

To run the project on an Android Virtual Device or on real debugging device

react-native run-android

or on the iOS Simulator by running (macOS only)

react-native run-ios

--

--