Charts not updating properly when properties are changed #997
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The _initChart function is not initialising the chart options properly. The props passed as a parameter are never used in the function which means that, when the function is being called from ChartControl.componentWillReceiveProps, the control is never updated with the new properties but it will use the old properties instead.
What's in this Pull Request?
Please describe the changes in this PR. Sample description or details around bugs which are being fixed.
If you look at the current implementation of the _initChart function the "props" parameter is never used. The function is using the props already in the object instead (this.props). Because this method is being called by the "ChartControl.componentWillReceiveProps" lifecycle method this means that the object will always be out of the date with the latest changes being passed in and will instead have the values of the previous changes. I hope this makes sense.