ricardodorosario / react-horizontal-stacked-bar-chart

React horizontal stacked bar responsive chart component
MIT License
19 stars 10 forks source link
bar chart horizontal-bar horizontal-chart horizontal-stacked-chart hsbar react react-component react-horizontal-bar reactjs reactjs-components stacked-chart

version release downloads license

react-horizontal-stacked-bar-chart

React horizontal stacked bar responsive chart component.

HSBar Example

Example

HSBar

Installation via NPM

npm install react-horizontal-stacked-bar-chart --save

Usage

import HSBar from "react-horizontal-stacked-bar-chart";

Simple

<HSBar data={[{ value: 10 }, { value: 20 }]} />

Complete

<HSBar
  height={50}
  showTextIn
  showTextUp
  showTextDown
  outlineWidth: {0.5},
  outlineColor: "black"
  id="new_id"
  fontColor="rgb(50,20,100)"
  data={[
    {
      name: "To pay",
      value: 80,
      description: "U$80,00",
      color: "red"
    },
    {
      name: "Paid",
      value: 200,
      description: "U$200,00",
      color: "rgb(150,150,220)"
    }
  ]}
  onClick={e => console.log(e.bar);}
/>

Properties

Default Properties

Data object list