0.2.5 • Published 4 years ago

react-chart-lib v0.2.5

Weekly downloads
18
License
MIT
Repository
github
Last release
4 years ago

react-chart

A simple React chart library

Contents:

Supports the following chart(s):

  • Pie Chart
  • Bar Chart
  • Line/Area Chart

Pie Chart

Usage:

<PieChart 
    data={
    [
        {name: "USA", amount: 0.4254},
        {name:"Netherlands", amount: 0.2322},
        {name:"South Africa", amount: 0.1716},
        {name:"Maldives", amount: 0.121},
        {name:"Belgium", amount: 0.0498}
    ]}
    legend={true}
    size={400}
    donut={true}
    donutThickness={0.6}
/>

Props:

NameDescription
dataThe data set, consisting of name, amount (value between 0 and 1) and an optional color (required)
sizeThe size of the chart in pixels (required)
legendWhether or not to show the legend (optional)
strokeColorThe outline of a non-hovered segment (optional)
hoverColorThe outline of a hovered segment (optional)
donutShow as a donut chart (optional)
donutThicknessThickness of the donut chart as a percentage of the radius (optional)

Bar Chart

Usage:

<BarChart 
    data={
    [
        {name: "USA", amount: 101},
        {name:"Netherlands", amount: 56.5},
        {name:"South Africa", amount: 23.2555},
        {name:"Maldives", amount: 3},
        {name:"Belgium", amount: 45.76}
    ]}
    legend={true}
    height={200}
/>

Props:

NameDescription
dataThe data set, consisting of name, amount and an optional color (required)
heightThe max height of the chart in pixels (required)
legendWhether or not to show the legend (optional)

Line/Area Chart

Usage:

<LineChart 
    data={
    [
        {name: "USA", points: [151,105,97,100,96]},
        {name:"Netherlands", points: [65,51,62,75,35]},
        {name:"South Africa", points: [42,32,54,67,23]},
        {name:"Belgium", points: [32,46,12,48,23]},
        {name:"Maldives", points: [25,12,5,3,37]}
    ]}
    legend={true}
    height={200}
    width={400}
    fillArea={false}
/>

Props:

NameDescription
dataThe data set, consisting of name, amount and an optional color (required)
heightThe max height of the chart in pixels (required)
widthThe max width of the chart in pixels (optional)
legendWhether or not to show the legend (optional)
fillAreaWhether or not to use a fill chart (optional)
0.2.5

4 years ago

0.2.1

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.4

4 years ago

0.2.0

4 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

1.0.0

6 years ago