GithubHelp home page GithubHelp logo

dgoemans / react-chart Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 1.13 MB

A simple React chart library

License: MIT License

CSS 8.03% JavaScript 91.97%
pie-chart chart react-chart-library react reactjs data-visualization data barchart piechart linechart

react-chart's Introduction

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:

Name Description
data The data set, consisting of name, amount (value between 0 and 1) and an optional color (required)
size The size of the chart in pixels (required)
legend Whether or not to show the legend (optional)
strokeColor The outline of a non-hovered segment (optional)
hoverColor The outline of a hovered segment (optional)
donut Show as a donut chart (optional)
donutThickness Thickness 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:

Name Description
data The data set, consisting of name, amount and an optional color (required)
height The max height of the chart in pixels (required)
legend Whether 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:

Name Description
data The data set, consisting of name, amount and an optional color (required)
height The max height of the chart in pixels (required)
width The max width of the chart in pixels (optional)
legend Whether or not to show the legend (optional)
fillArea Whether or not to use a fill chart (optional)

react-chart's People

Contributors

dependabot[bot] avatar dgoemans avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.