Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

Updated to newer React syntax #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Installation
------------
This is a CommonJS component only (to be used with something like Webpack or Browserify)
```
npm install --save react-chartjs
npm install react-chartjs-2 --save
```
You must also include [chart.js](https://www.npmjs.com/package/chart.js) and [React](https://www.npmjs.com/package/react) as dependencies.
```
Expand All @@ -26,13 +26,13 @@ npm install --save chart.js@^1.1.1 react react-dom
Example Usage
-------------
```javascript
var LineChart = require("react-chartjs").Line;
import { Line } from "react-chartjs-2"

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

* ```data``` represents the chart data (see [chart.js](https://github.com/chartjs/Chart.js/tree/v1.1.1/docs) for details)
Expand Down