A pie chart represented with relative frequencies
npm install react-pie-graph-chart``sh`
npm install react-pie-graph-chart
`sh`
yarn add react-pie-graph-chart
1 . Require react-pie-graph-chart after installation
`js`
import PieChart from 'react-pie-graph-chart';
2 . Include PieChart component
`jsx`
#### data prop expects an array of objects that accepts the following properties:
- type: key value.
- value: represents the percentage that each slice is worth.
- color: slice color need to be in hexadecimal.
`jsx``
type: "Bus",
value: 235,
color: "#E97D30"
},
{
type: "Bicycle",
value: 165,
color: "#62B170"
},
{
type: "Train",
value: 90,
color: "#F1AF13"
},
{
type: "Car",
value: 345,
color: "#4BA2DA"
}
]} />