# rntpc_react-native-gifted-charts
**Repository Path**: openharmony-sig/rntpc_react-native-gifted-charts
## Basic Information
- **Project Name**: rntpc_react-native-gifted-charts
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: https://gitee.com/openharmony-sig/rntpc_react-native-gifted-charts
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-10-14
- **Last Updated**: 2025-05-07
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 🚨 **重要提示 | IMPORTANT**
>
> **⚠️ 此代码仓已归档。新地址请访问 [rntpc_react-native-gifted-charts](https://gitcode.com/openharmony-sig/rntpc_react-native-gifted-charts)。| ⚠️ This repository has been archived. For the new address, please visit [rntpc_react-native-gifted-charts](https://gitcode.com/openharmony-sig/rntpc_react-native-gifted-charts).**
>
---
>
# react-native-gifted-charts
The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar and Population Pyramid charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.
### Yet another chart library? Why?
**_To bring Life to your data_**
1. Plenty of features with minimal code
2. Apply animations to your charts on load and on value change, just by adding a prop
3. Smooth animations implemented using LayoutAnimation
4. Clickable and scrollable
5. Three-D and gradient effects
6. Fully customizable (see the [props](docs/docs.md))
7. Detailed [documentation](https://gifted-charts.web.app/) with examples
8. Support for **_combined_** Bar and Line charts
9. Tested to be pixel perfect using [react-native-screenshot-test](https://www.npmjs.com/package/react-native-screenshot-test). See [the screenshot tests here](https://abhinandan-kushwaha.github.io/TestingCharts/ss-test/test.html)
The web counterpart of this library is public now. Try out our new reactJS library- [react-gifted-charts](https://www.npmjs.com/package/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 🎉](release-notes/release-notes.md)
See the **[release changes by version here.](release-notes/release-notes.md)**
---
## Installation
### React Native CLI
```sh
npm install react-native-gifted-charts react-native-linear-gradient react-native-svg
```
### Expo
```sh
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](https://www.npmjs.com/package/gifted-charts-core)** contains the mathematical and logical utilities used by this library.
# Docs
[Documentation and gallery](https://gifted-charts.web.app/)
## Usage
The simplest usage of various types of charts can be done as below-
```js
import { BarChart, LineChart, PieChart, PopulationPyramid } from "react-native-gifted-charts";
// ...
const data=[ {value:50}, {value:80}, {value:90}, {value:70} ]
// For Horizontal Bar chart, just add the prop horizontal to the component
// For Area chart, just add the prop areaChart to the component
// For Donut chart, just add the prop donut to the component
```
## Props tables
**[1. BarChart, Horizontal BarChart and Stacked Bar Chart props](docs/BarChart/BarChartProps.md)** \
**[2. LineChart and AreaChart props](docs/LineChart/LineChartProps.md)** \
**[3. PieChart and DonutChart props](docs/PieChart/PieChartProps.md)** \
**[4. Population Pyramid props](docs/PopulationPyramid/PopulationPyramid.md)**
## 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](https://github.com/Abhinandan-Kushwaha/react-native-gifted-charts/issues).
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](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
[To do list](./src/todos.md)
## Test cases
Test strategy and cases are discussed here- [TESTS.md](./TESTS.md)
Pixel perfection is assured using [react-native-screenshot-test](https://www.npmjs.com/package/react-native-screenshot-test).
200+ screenshot tests have been written. See the [Reports here](https://abhinandan-kushwaha.github.io/TestingCharts/ss-test/test.html).
Screenshot tests are written in a separate repo named [TestingCharts](https://github.com/Abhinandan-Kushwaha/TestingCharts)
## License
MIT