Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charts not updating properly when properties are changed #997

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

hesperanca
Copy link
Contributor

@hesperanca hesperanca commented Aug 24, 2021

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.

Q A
Bug fix? [ X]
New feature? [ ]
New sample? [ ]
Related issues? fixes #X, partially #Y, mentioned in #Z

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.

The _initChart function is not initialising the chart options properly. The options 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.
@hesperanca hesperanca changed the title Update ChartControl.tsx Charts not updating properly when properties are changed Aug 24, 2021
@AJIXuMuK AJIXuMuK changed the base branch from master to dev September 2, 2021 00:54
@AJIXuMuK AJIXuMuK merged commit 94c6f37 into pnp:dev Sep 2, 2021
@AJIXuMuK
Copy link
Collaborator

AJIXuMuK commented Sep 2, 2021

Thank you @hesperanca for the fix!
It has been merged and will be included in the next release!

@AJIXuMuK AJIXuMuK added this to the 3.4.0 milestone Sep 2, 2021
@hesperanca
Copy link
Contributor Author

Thank you @hesperanca for the fix!
It has been merged and will be included in the next release!

@AJIXuMuK That's great Alex. Thanks for letting me know.

@estruyf estruyf mentioned this pull request Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants