0.0.3 • Published 6 years ago

bs-recharts v0.0.3

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

bs-recharts

This is Bucklescript bindings for Recharts. It is not completed, we are adding bindings as we go.

Install

yarn add bs-recharts

Setup

Add bs-recharts to bs-depenencies in your bs-config. bs!

{
  /* ... */
  "bs-dependencies": [
    "bs-recharts"
  ],
  /* ... */
}

Usage Example

open BsRecharts;

let component = ReasonReact.statelessComponent("SomeComponent");

let make = (_children) => {
  ...component,

  render: (data, _self) => {
    <ResponsiveContainer height=200>
      <BarChart
        barCategoryGap=0.5
        margin={"top": 0, "right": 0, "bottom": 0, "left": 0}
        data=data>
        <Bar
          name="Some bar"
          dataKey="key1"
          fill="#2078b4"
          stackId="a"
        />
        <Bar
          name="Other bar"
          dataKey="key2"
          fill="#ff7f02"
          stackId="a"
        />
        <Tooltip />
        <Legend align="left" iconType="circle" />
      </BarChart>
    </ResponsiveContainer>
  }
};

Check Reacharts documentation for available props.