# react-chartjs

> react charting components using the chartjs lib

Latest version **1.2.0** (published 2018-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-chartjs
pnpm add react-chartjs
yarn add react-chartjs
bun add react-chartjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2018-01-05 |
| First published | 2014-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2910 |
| Author | Joe Hudson |
| Maintainers | benmccann, jerairrest, arjunskumar47, austinpray, jhudson |
| Keywords | react, react-component, chart, charts, graph, chartjs |

## Links

- npm: https://www.npmjs.com/package/react-chartjs
- Repository: https://github.com/jhudson8/react-chartjs
- Issues: https://github.com/jhudson8/react-chartjs/issues
- npm.io page: https://npm.io/package/react-chartjs

## Dependencies (1)

- [create-react-class](https://npm.io/package/create-react-class.md) ^15.6.2

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2018-01-05
- 2.0.0-beta2 (beta) — 2017-04-12
- 1.1.0 — 2018-01-05
- 1.0.0 — 2018-01-04
- 2.0.0-beta1 — 2017-04-06
- 0.8.0 — 2016-07-26
- 0.7.3 — 2016-01-26
- 0.6.0 — 2015-03-26
- 0.5.0 — 2015-02-23
- 0.4.0 — 2015-02-08
- 0.3.0 — 2015-02-06
- 0.2.1 — 2015-01-26
- 0.2.0 — 2015-01-26
- 0.1.3 — 2015-01-19
- 0.1.2 — 2015-01-13
- … 3 more at https://npm.io/package/react-chartjs/versions

## README

react-chartjs
============

rich interactive react charting components using [chart.js](http://www.chartjs.org/) including

* Line chart
* Bar chart
* Radar chart
* Polar area chart
* Pie chart
* Doughnut chart

[view chart examples](http://reactjs.github.io/react-chartjs/index.html)

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](https://www.npmjs.com/package/chart.js) and [React](https://www.npmjs.com/package/react) as dependencies.  
```
npm install --save chart.js@^1.1.1 react react-dom
```  

Example Usage
-------------
```javascript
var LineChart = require("react-chartjs").Line;

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

* ```data``` represents the chart data (see [chart.js](http://www.chartjs.org/) for details)
* ```options``` represents the chart options (see [chart.js](http://www.chartjs.org/) for details)
* all other parameters will be passed through to the ```canvas``` element
* if data passed into the component changes, points will animate between values using chart.js' ```.update()```. If you want the chart destroyed and redrawn on every change, pass in ```redraw``` as a prop. For example ```<LineChart data={this.state.chartData} redraw />```

Chart References
----------------
The ```canvas``` element can be retrieved using ```getCanvas``` and the ```chartjs object``` can be retrieved using ```getChart```.

---
_Source: https://npm.io/package/react-chartjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
