Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-chartjs-roundedbar-wrapper

aomran3MITdeprecated2.6.0

this package has been deprecated

Simple React.js component for Chart.js

react-component, chart.js

readme

React Chart.js Wrapper

Build Status npm version Coverage Status

This is a simple wrapper for ChartJS as a React.js component.

Installation

$ npm install react-chartjs-wrapper --save

Usage

import React from 'react';
import ChartJS from 'react-chartjs-wrapper';

class ParentComponent extends React.Component {
  constructor(props) {
    super(props);
    let data = {
      datasets: [{
        data: [10, 20, 30],
        backgroundColor: ["#F7464A", "#46BFBD", "#FDB45C"],
        hoverBackgroundColor: ["#FF5A5E", "#5AD3D1", "#FFC870"]
      }],
      labels: ['Red', 'Yellow', 'Blue']
    };
    this.state = {
      data: data,
      type: 'pie'
    };
  }

  render() {
    return <div>
      <h1>Chart.js Demo</h1>
      <ChartJS type={this.state.type} data={this.state.data} />
    </div>
  }
}