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

Commit

Permalink
Merge pull request #54 from hull/master
Browse files Browse the repository at this point in the history
React 0.14
  • Loading branch information
joshhornby committed Nov 30, 2015
2 parents 6fe5ca9 + 77b34d7 commit 2929791
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/core.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
var React = require('react');
var ReactDOM = require('react-dom');

module.exports = {
createClass: function(chartType, methodNames, dataKey) {
var classData = {
Expand Down Expand Up @@ -50,7 +53,7 @@ module.exports = {

classData.initializeChart = function(nextProps) {
var Chart = require('chart.js');
var el = this.getDOMNode();
var el = ReactDOM.findDOMNode(this);
var ctx = el.getContext("2d");
var chart = new Chart(ctx)[chartType](nextProps.data, nextProps.options || {});
this.state.chart = chart;
Expand All @@ -63,7 +66,7 @@ module.exports = {

// return the canvass element that contains the chart
classData.getCanvass = function() {
return this.refs.canvass.getDOMNode();
return this.refs.canvass;
};

classData.getCanvas = classData.getCanvass;
Expand All @@ -76,7 +79,6 @@ module.exports = {
extra(methodNames[i]);
}

var React = require('react');
return React.createClass(classData);
}
};
Expand Down Expand Up @@ -121,4 +123,3 @@ var addData = function(nextProps, chart, setIndex, pointIndex) {
});
chart.addData(values, nextProps.data.labels[setIndex]);
};

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"homepage": "https://github.com/jhudson8/react-chartjs",
"peerDependencies": {
"react": "*",
"react-dom": "*",
"chart.js": "*"
},
"devDependencies": {
Expand Down

0 comments on commit 2929791

Please sign in to comment.