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 #48 from netsyno/master
Browse files Browse the repository at this point in the history
Make react-charts compatible with [email protected]
  • Loading branch information
oliger committed Oct 9, 2015
2 parents 6fe5ca9 + f77d98e commit f7a0a7d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/core.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
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 Down

0 comments on commit f7a0a7d

Please sign in to comment.