1.0.3 • Published 2 years ago

react-pie-graph-chart v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

React Pie Graph Chart

Installation

npm install react-pie-graph-chart
yarn add react-pie-graph-chart

Usage

1 . Require react-pie-graph-chart after installation

import PieChart from 'react-pie-graph-chart';

2 . Include PieChart component

<PieChart data={...} />

Configuration

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.

Example

<PieChart data={[
    {
      type: "Bus",
      value: 235,
      color: "#E97D30"
    },
    {
      type: "Bicycle",
      value: 165,
      color: "#62B170"
    },
    {
      type: "Train",
      value: 90,
      color: "#F1AF13"
    },
    {
      type: "Car",
      value: 345,
      color: "#4BA2DA"
    }
  ]} />

👍 If you liked this repository

⭐ Feel free to leave a star

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago