Giter Site home page Giter Site logo

abhishekvirat0 / react-race-chart Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 14.13 MB

react bar-chart for React.

Home Page: https://www.npmjs.com/package/react-race-chart

JavaScript 100.00%
reactjs react-chart bar-chart react-chart-library reactjs-chart

react-race-chart's Introduction

react-race-chart

Seamless & fully customizable bar chart for React.The result of bar chart is already sorted in descending order so you don't need to write extra code for that purpose.


Quick Start

npm install --save react-race-chart
import BarChart from 'react-race-chart';

You should wrap BarChart inside a container div that acts as a sandbox. The width of the BarChart fits the container width.

<div style={{width: "500px"}}>
    <BarChart />
</div>

Usage

Passing props.

You will need to pass your own props to the BarChart component. Refer to examples for more information.

Prop Type Explanation
start Boolean Defines whether the bar chart race has started. Default is true and the chart race will start as the component mounts.
data Object An object with keys being the data field name and value being Array data. data[key].length should be equal to len.
timeline Array An array defining the time indices. Length should be equal to len.
labels Object An object with keys being the data field name and value being a HTML element that acts as the data field's label.
colors Object An object with keys being the data field name and value being the color the data bar.
timeout Integer Transition time between adjacent time indices (in ms).
delay Integer Waiting time between adjacent time indices (in ms).
timelineStyle Object CSS style objects for time indices.
textBoxStyle Object CSS style objects for data text.
barStyle Object CSS style object defining the style of all the bars. It is advised to use height to define the thickness and marginTop to define the distance between adjacent bars.
width Array Defines the width allocation for label, bar, and text box. Values in width should add up to 100.
maxItems Integer Defines the maximum number of items to show in the chart. Should be less or equal to Object.keys(data).length.

More Demo

Easibly define custom data, text styles, colors, duration, and layout.

Add images to data labels.

population-race


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.