diff --git a/lib/core.js b/lib/core.js index 0d91e02..bbfe734 100644 --- a/lib/core.js +++ b/lib/core.js @@ -59,10 +59,18 @@ module.exports = { chart.data.labels = []; // Adds the datapoints from nextProps + var propsToCopy = ['hidden']; + nextProps.data.datasets.forEach(function(set, setIndex) { set.data.forEach(function(val, pointIndex) { chart.data.datasets[setIndex].data[pointIndex] = nextProps.data.datasets[setIndex].data[pointIndex]; }); + + propsToCopy.forEach(function(prop) { + if (nextProps.data.datasets[setIndex][prop] !== undefined) { + chart.data.datasets[setIndex][prop] = nextProps.data.datasets[setIndex][prop]; + } + }); }); // Sets the labels from nextProps @@ -118,4 +126,4 @@ module.exports = { return React.createClass(classData); } -}; \ No newline at end of file +};