ReactJS counterpart of react-native-gifted-charts. An intuitive charting library for Bar, Line, Area, Pie, Donut, Stacked Bar, Population Pyramid and Radar charts in React
npm install react-gifted-chartsReactJS counterpart of react-native-gifted-charts. An intuitive charting library for Bar, Line, Area, Pie, Donut, Stacked Bar, Population Pyramid and Radar charts in React.
``sh`
npm i react-gifted-charts @react-spring/web
Note: If you are facing issues related to react-refresh, add below code to your package.json-`js`
"overrides": {
"react-refresh": "0.11.0"
},
The simplest usage of various types of charts can be done as below-
`js
import { BarChart, LineChart, PieChart, PopulationPyramid } from "react-gifted-charts";
// ...
const data=[ {value:50}, {value:80}, {value:90}, {value:70} ]
// For Horizontal Bar chart, just add the prop horizontal to the
// For Area chart, just add the prop areaChart to the
// For Donut chart, just add the prop donut to the
``
Screenshot tests are written in the react-gifted-charts-test repo using screenshot-test-react
See the test reports here