diff --git a/lib/core.js b/lib/core.js index b39d67b..34ed124 100644 --- a/lib/core.js +++ b/lib/core.js @@ -3,7 +3,7 @@ var ReactDOM = require('react-dom'); module.exports = { createClass: function(chartType, methodNames, dataKey) { - var excludedProps = ['data', 'options', 'redraw']; + var excludedProps = ['data', 'options', 'redraw', 'nextPoints', 'stream']; var classData = { displayName: chartType + 'Chart', getInitialState: function() { return {}; }, @@ -43,6 +43,9 @@ module.exports = { if (nextProps.redraw) { chart.destroy(); this.initializeChart(nextProps); + } else if (nextProps.stream && nextProps.data.nextPoints) { + chart.addData(nextProps.data.nextPoints.values, nextProps.data.nextPoints.label); + chart.removeData(); } else { dataKey = dataKey || dataKeys[chart.name]; updatePoints(nextProps, chart, dataKey);