react-native-gifted-charts
TypeScript icon, indicating that this package has built-in type declarations

1.4.47 • Public • Published

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)
  7. Detailed documentation with examples
  8. Support for combined Bar and Line charts
  9. Tested to be pixel perfect using react-native-screenshot-test. See the screenshot tests here

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!

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

Documentation and gallery

Usage

The simplest usage of various types of charts can be done as below-

import { BarChart, LineChart, PieChart, PopulationPyramid } 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}]} />

// 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

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

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.4.4710,254latest

Version History

VersionDownloads (Last 7 Days)Published
1.4.4710,254
1.4.46500
1.4.45144
1.4.441,746
1.4.432,152
1.4.420
1.4.41600
1.4.4012
1.4.39142
1.4.387
1.4.370
1.4.3645
1.4.351
1.4.3433
1.4.33306
1.4.32120
1.4.31293
1.4.301,173
1.4.291,492
1.4.28230
1.4.270
1.4.2639
1.4.2510
1.4.241
1.4.23441
1.4.22136
1.4.210
1.4.2015
1.4.19166
1.4.180
1.4.17103
1.4.16581
1.4.15144
1.4.14257
1.4.139
1.4.120
1.4.11316
1.4.101,276
1.4.9201
1.4.818
1.4.72,209
1.4.63
1.4.575
1.4.42
1.4.312
1.4.221
1.4.11
1.4.00
1.3.33392
1.3.3258
1.3.312
1.3.3015
1.3.2973
1.3.28136
1.3.2713
1.3.2614
1.3.2513
1.3.248
1.3.2371
1.3.220
1.3.210
1.3.200
1.3.19186
1.3.180
1.3.171
1.3.16387
1.3.153
1.3.140
1.3.1313
1.3.1256
1.3.1187
1.3.1031
1.3.945
1.3.813
1.3.715
1.3.66
1.3.5256
1.3.47
1.3.256
1.3.10
1.3.00
1.2.42555
1.2.41102
1.2.400
1.2.390
1.2.380
1.2.370
1.2.360
1.2.350
1.2.342
1.2.330
1.2.320
1.2.310
1.2.300
1.2.290
1.2.280
1.2.270
1.2.260
1.2.250
1.2.2419
1.2.230
1.2.220
1.2.210
1.2.200
1.2.190
1.2.180
1.2.176
1.2.160
1.2.150
1.2.140
1.2.130
1.2.120
1.2.110
1.2.100
1.2.90
1.2.80
1.2.70
1.2.60
1.2.50
1.2.40
1.2.32
1.2.20
1.2.10
1.2.053
1.0.211
1.0.201
1.0.191
1.0.181
1.0.171
1.0.160
1.0.150
1.0.140
1.0.131
1.0.120
1.0.110
1.0.100
1.0.91
1.0.80
1.0.70
1.0.60
1.0.50
1.0.41
1.0.30
1.0.20
1.0.10
1.0.01
0.2.91
0.2.80
0.2.70
0.2.60
0.2.50
0.2.40
0.2.30
0.2.21
0.2.11
0.2.00
0.1.181
0.1.170
0.1.160
0.1.150
0.1.140
0.1.132
0.1.120
0.1.110
0.1.100
0.1.90
0.1.80
0.1.70
0.1.60
0.1.50
0.1.42
0.1.30
0.1.20
0.1.10
0.1.00
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.31
0.0.20
0.0.10

Package Sidebar

Install

npm i react-native-gifted-charts

Weekly Downloads

28,000

Version

1.4.47

License

MIT

Unpacked Size

310 kB

Total Files

63

Last publish

Collaborators

  • ak_97