diff --git a/lib/core.js b/lib/core.js index 1c1a4d7..f0b63c0 100644 --- a/lib/core.js +++ b/lib/core.js @@ -48,9 +48,10 @@ module.exports = { classData.componentWillReceiveProps = function(nextProps) { var chart = this.state.chart; + var optsChange = JSON.stringify(nextProps.options) !== JSON.stringify(this.props.options); - if (nextProps.redraw) { - chart.destroy(); // Reset the array of datasets + if (nextProps.redraw || optsChange) { + chart.destroy(); // Reset the array of datasets this.initializeChart(nextProps); } else { // assign all of the properites from the next datasets to the current chart