react-native-gifted-charts
The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar, Population Pyramid and Radar charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.
Top Related Projects
a react native charts wrapper (support android & iOS)
π One library to rule all charts for React Native π
victory components for react native
πReact Native Chart Kit: Line Chart, Bezier Line Chart, Progress Ring, Bar chart, Pie chart, Contribution graph (heatmap)
π Beautiful, high-performance Graphs and Charts for React Native built with Skia
Quick Overview
React Native Gifted Charts is a powerful and customizable charting library for React Native applications. It offers a wide range of chart types, including line charts, bar charts, pie charts, and more, with smooth animations and interactive features.
Pros
- Extensive customization options for colors, styles, and animations
- Supports various chart types and combinations
- Smooth animations and interactive features
- Well-documented with many examples
Cons
- Limited support for advanced chart types (e.g., candlestick charts)
- Some users report performance issues with large datasets
- Occasional bugs and inconsistencies across different React Native versions
- Limited community support compared to more established charting libraries
Code Examples
- Basic Line Chart:
import { LineChart } from 'react-native-gifted-charts';
const data = [
{value: 50},
{value: 80},
{value: 90},
{value: 70},
];
<LineChart data={data} />
- Customized Bar Chart:
import { BarChart } from 'react-native-gifted-charts';
const data = [
{value: 50, frontColor: '#177AD5'},
{value: 80, frontColor: '#177AD5'},
{value: 90, frontColor: '#177AD5'},
{value: 70, frontColor: '#177AD5'},
];
<BarChart
data={data}
barWidth={22}
spacing={24}
roundedTop
roundedBottom
hideRules
xAxisThickness={0}
yAxisThickness={0}
yAxisTextStyle={{color: 'gray'}}
/>
- Pie Chart with Labels:
import { PieChart } from 'react-native-gifted-charts';
const pieData = [
{value: 54, color: '#177AD5', text: '54%'},
{value: 40, color: '#79D2DE', text: '40%'},
{value: 6, color: '#ED6665', text: '6%'},
];
<PieChart
data={pieData}
donut
showText
textColor="black"
radius={130}
innerRadius={80}
/>
Getting Started
-
Install the package:
npm install react-native-gifted-charts
-
Import and use the desired chart component in your React Native app:
import { LineChart, BarChart, PieChart } from 'react-native-gifted-charts'; // Use the components in your render method <LineChart data={lineData} /> <BarChart data={barData} /> <PieChart data={pieData} />
-
Customize the charts using props as needed. Refer to the documentation for detailed information on available props and customization options.
Competitor Comparisons
a react native charts wrapper (support android & iOS)
Pros of react-native-charts-wrapper
- Based on popular MPAndroidChart and Charts libraries, offering a wide range of chart types and customization options
- Supports both Android and iOS platforms natively
- Provides more advanced features like real-time updates and animations
Cons of react-native-charts-wrapper
- Steeper learning curve due to its complexity and extensive API
- Less frequent updates and maintenance compared to react-native-gifted-charts
- Requires linking native dependencies, which can be challenging for some developers
Code Comparison
react-native-charts-wrapper:
<LineChart
data={{
dataSets: [{
values: [{y: 1}, {y: 2}, {y: 3}],
label: 'Dataset 1',
}],
}}
style={styles.chart}
/>
react-native-gifted-charts:
<LineChart
data={[
{value: 1},
{value: 2},
{value: 3},
]}
width={300}
height={200}
/>
Both libraries offer similar basic functionality, but react-native-charts-wrapper provides more detailed configuration options, while react-native-gifted-charts focuses on simplicity and ease of use.
π One library to rule all charts for React Native π
Pros of react-native-svg-charts
- More established project with longer history and larger community
- Supports a wider variety of chart types, including area charts and progress circles
- Offers more customization options for axes, grids, and decorators
Cons of react-native-svg-charts
- Less frequent updates and maintenance compared to react-native-gifted-charts
- Steeper learning curve due to more complex API and configuration options
- Limited animation capabilities out of the box
Code Comparison
react-native-svg-charts:
import { LineChart, Grid } from 'react-native-svg-charts'
<LineChart
style={{ height: 200 }}
data={[50, 10, 40, 95, 85]}
svg={{ stroke: 'rgb(134, 65, 244)' }}
contentInset={{ top: 20, bottom: 20 }}
>
<Grid />
</LineChart>
react-native-gifted-charts:
import { LineChart } from 'react-native-gifted-charts'
<LineChart
data={[
{value: 50},
{value: 10},
{value: 40},
{value: 95},
{value: 85}
]}
width={300}
height={200}
color="rgb(134, 65, 244)"
/>
Both libraries offer similar basic functionality, but react-native-svg-charts provides more built-in components like Grid, while react-native-gifted-charts has a simpler API for basic use cases.
victory components for react native
Pros of victory-native
- More comprehensive and flexible charting library with a wider range of chart types
- Better documentation and examples, making it easier for developers to implement
- Stronger community support and more frequent updates
Cons of victory-native
- Steeper learning curve due to its extensive API and configuration options
- Larger bundle size, which may impact app performance, especially on lower-end devices
Code Comparison
victory-native:
import { VictoryBar } from "victory-native";
<VictoryBar
data={[
{ x: "A", y: 1 },
{ x: "B", y: 2 },
{ x: "C", y: 3 }
]}
/>
react-native-gifted-charts:
import { BarChart } from "react-native-gifted-charts";
<BarChart
data={[
{ value: 1, label: "A" },
{ value: 2, label: "B" },
{ value: 3, label: "C" }
]}
/>
Both libraries offer similar basic functionality for creating charts, but victory-native provides more customization options and chart types. react-native-gifted-charts has a simpler API, making it easier to get started quickly, but may lack some advanced features found in victory-native.
πReact Native Chart Kit: Line Chart, Bezier Line Chart, Progress Ring, Bar chart, Pie chart, Contribution graph (heatmap)
Pros of react-native-chart-kit
- More established project with a longer history and larger community
- Supports a wider variety of chart types, including progress rings and contribution graphs
- Simpler API for basic chart creation
Cons of react-native-chart-kit
- Less customization options for advanced chart styling
- Limited animation capabilities compared to react-native-gifted-charts
- Fewer updates and slower development cycle
Code Comparison
react-native-chart-kit:
<LineChart
data={{
labels: ["January", "February", "March", "April", "May", "June"],
datasets: [{ data: [20, 45, 28, 80, 99, 43] }]
}}
width={Dimensions.get("window").width}
height={220}
/>
react-native-gifted-charts:
<LineChart
data={[
{value: 20}, {value: 45}, {value: 28}, {value: 80}, {value: 99}, {value: 43}
]}
width={300}
height={200}
showXAxisLabels={true}
xAxisLabelTexts={["Jan", "Feb", "Mar", "Apr", "May", "Jun"]}
/>
Both libraries offer straightforward ways to create basic charts, but react-native-gifted-charts provides more granular control over data points and styling options. react-native-chart-kit has a more concise API for simple use cases, while react-native-gifted-charts offers greater flexibility for complex visualizations and animations.
π Beautiful, high-performance Graphs and Charts for React Native built with Skia
Pros of react-native-graph
- Lightweight and focused specifically on line graphs
- Smooth animations and interactions out of the box
- Written in TypeScript, providing better type safety
Cons of react-native-graph
- Limited to line graphs only, less versatile than react-native-gifted-charts
- Fewer customization options and chart types available
- Smaller community and potentially less frequent updates
Code Comparison
react-native-graph:
import { LineGraph } from 'react-native-graph'
<LineGraph
points={[{ x: 0, y: 0 }, { x: 1, y: 1 }, { x: 2, y: 2 }]}
animated={true}
/>
react-native-gifted-charts:
import { LineChart } from 'react-native-gifted-charts'
<LineChart
data={[{ value: 0 }, { value: 1 }, { value: 2 }]}
width={300}
height={200}
/>
The code comparison shows that react-native-graph uses a more straightforward points
prop with x
and y
values, while react-native-gifted-charts uses a data
prop with value
properties. react-native-graph also includes an animated
prop for easy animation control.
react-native-gifted-charts offers more chart types and customization options, making it suitable for complex visualizations. However, react-native-graph provides a simpler API for basic line graphs with built-in animations, which may be preferable for projects with simpler graphing needs.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
react-native-gifted-charts
The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar, Population Pyramid and Radar charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.Yet another chart library? Why?
To bring Life to your data
- Plenty of features with minimal code
- Apply animations to your charts on load and on value change, just by adding a prop
- Smooth animations implemented using LayoutAnimation
- Clickable and scrollable
- Three-D and gradient effects
- Fully customizable (see the props)
- Detailed documentation with examples
- Support for combined Bar and Line charts
- Tested to be pixel perfect using react-native-screenshot-test. See the screenshot tests here
- Detailed and illustrated dev docs that explain the architecture and working of the library
The web counterpart of this library is public now. Try out our new reactJS library- react-gifted-charts
The exact same piece of code that you write to render charts in react-native, can be used to render charts in reactJS using this library!
Release notes (Changelog) Γ°ΒΒΒ
See the release changes by version here.



![]() |
![]() |
![]() |
![]() |
![]() |
![]() |

Installation
React Native CLI
npm install react-native-gifted-charts react-native-linear-gradient react-native-svg
Expo
npx expo install react-native-gifted-charts expo-linear-gradient react-native-svg
Please note that react-native-svg
and react-native-linear-gradient
/expo-linear-gradient
are needed for the library to work, so make sure they are installed in your project.
gifted-charts-core contains the mathematical and logical utilities used by this library.
Γ°ΒΒΒ Docs & Demos Γ°ΒΒΒ¦
- Documentation and gallery
- Architecture and working (dev docs)
- Demo repo and snacks list
- Demo app on Play Store
Usage
The simplest usage of various types of charts can be done as below-
import { BarChart, LineChart, PieChart, PopulationPyramid, RadarChart } from "react-native-gifted-charts";
// ...
const data=[ {value:50}, {value:80}, {value:90}, {value:70} ]
<BarChart data = {data} />
<LineChart data = {data} />
<PieChart data = {data} />
<PopulationPyramid data = {[{left:10,right:12}, {left:9,right:8}]} />
<RadarChart data = {[50, 80, 90, 70]} />
// For Horizontal Bar chart, just add the prop horizontal to the <BarChart/> component
<BarChart data = {data} horizontal />
// For Area chart, just add the prop areaChart to the <LineChart/> component
<LineChart data = {data} areaChart />
// For Donut chart, just add the prop donut to the <PieChart/> component
<PieChart data = {data} donut />
Props tables
1. BarChart, Horizontal BarChart and Stacked Bar Chart props
2. LineChart and AreaChart props
3. PieChart and DonutChart props
4. Population Pyramid props
5. RadarChart props
ð€ Contributing
This project exists thanks to all the people who contribute.
Dear developers! Your small contribution can make someone's day Γ°ΒΒΒ
One of the ways you can contribute is to address an open issue.
Sometimes people report issues which don't exist, or request for features which are already present. Such issues can be addressed without pushing any code to the repo. Just show them in the comments how to do it.
See the contributing guide to learn how to contribute to the repository and the development workflow.
Γ°ΒΒΒ To do list
Γ°ΒΒ§Β Test cases
- Test strategy and cases are discussed here- TESTS.md
- Pixel perfection is assured using react-native-screenshot-test.
- 220+ screenshot tests have been written. See the Reports here.
- Screenshot tests are written in a separate repo named TestingCharts
Γ°ΒΒΒ Showcase
Showcase your dashing charts on Expo snack and list them on the Demo app repo.
Your snack might get published in the Demo app on Play Store!
License
MIT
Top Related Projects
a react native charts wrapper (support android & iOS)
π One library to rule all charts for React Native π
victory components for react native
πReact Native Chart Kit: Line Chart, Bezier Line Chart, Progress Ring, Bar chart, Pie chart, Contribution graph (heatmap)
π Beautiful, high-performance Graphs and Charts for React Native built with Skia
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot