reactjs / react-chartjs

common react charting components using chart.js
MIT License
2.93k stars 299 forks source link

react-chartjs

rich interactive react charting components using chart.js including

view chart examples

Installation

This is a CommonJS component only (to be used with something like Webpack or Browserify)

npm install --save react-chartjs

You must also include chart.js and React as dependencies.

npm install --save chart.js@^1.1.1 react react-dom

Example Usage

var LineChart = require("react-chartjs").Line;

var MyComponent = React.createClass({
  render: function() {
    return <LineChart data={chartData} options={chartOptions} width="600" height="250"/>
  }
});

Chart References

The canvas element can be retrieved using getCanvas and the chartjs object can be retrieved using getChart.