diff --git a/app/scripts/src/charts/bar_chart.jsx b/app/scripts/src/charts/bar_chart.jsx index 5fc1d71..47f4912 100644 --- a/app/scripts/src/charts/bar_chart.jsx +++ b/app/scripts/src/charts/bar_chart.jsx @@ -25,7 +25,9 @@ var BarChart = React.createClass({ componentWillReceiveProps: function(newProps) { this.setState({ - item: newProps.items[0], + item: (_.isEqual(newProps.items, this.props.items) + ? this.state.item + : newProps.items[0]), state: 'newProps' }, this.fetchData); }, diff --git a/app/scripts/src/charts/stacked_area_chart.jsx b/app/scripts/src/charts/stacked_area_chart.jsx index d96cec8..31b9240 100644 --- a/app/scripts/src/charts/stacked_area_chart.jsx +++ b/app/scripts/src/charts/stacked_area_chart.jsx @@ -38,7 +38,9 @@ var StackedAreaChart = React.createClass({ componentWillReceiveProps: function(newProps) { this.setState({ - item: newProps.items[0], + item: (_.isEqual(newProps.items, this.props.items) + ? this.state.item + : newProps.items[0]), state: 'newProps' }, this.fetchData); },