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

Commit f7a0a7d

Browse files
committed
Merge pull request #48 from netsyno/master
Make react-charts compatible with [email protected]
2 parents 6fe5ca9 + f77d98e commit f7a0a7d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/core.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
var ReactDOM = require('react-dom');
2+
3+
14
module.exports = {
25
createClass: function(chartType, methodNames, dataKey) {
36
var classData = {
@@ -50,7 +53,7 @@ module.exports = {
5053

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

6467
// return the canvass element that contains the chart
6568
classData.getCanvass = function() {
66-
return this.refs.canvass.getDOMNode();
69+
return this.refs.canvass;
6770
};
6871

6972
classData.getCanvas = classData.getCanvass;

0 commit comments

Comments
 (0)