Hey guys, there is some behavior associated with this line.
https://github.com/chartjs/Chart.js/blob/master/src/core/core.controller.js#L162
During the options setter, some update mechanism is started even before the chart.update function was called. If there is a dependence on data, this causes an issue, when options were updated incorrectly. Because of this, it is mandatory to update data before the options are updated.
Expected Behavior
It is expected that data and options can be updated in any order. Should not be affected while the update function has been called.
Current Behavior
If you update options before data, an error occurs.
Steps to Reproduce
The error was found by one of the wrapper users. I will add a link, maybe this will give you more data for analysis.
xr0master/chartjs-react#10
https://codesandbox.io/s/damp-surf-znpnz
This playground uses a wrapper, but it doesn't really matter. The important thing is that if you update data and then the options, the bug with the axes does not occur. Two different versions of the wrapper are used to show the issue: [options, data], [data, options].
Environment
- Chart.js version: beta.11
Thanks for @ace-han investigation
Hey guys, there is some behavior associated with this line.
https://github.com/chartjs/Chart.js/blob/master/src/core/core.controller.js#L162
During the options setter, some update mechanism is started even before the
chart.updatefunction was called. If there is a dependence on data, this causes an issue, when options were updated incorrectly. Because of this, it is mandatory to update data before the options are updated.Expected Behavior
It is expected that data and options can be updated in any order. Should not be affected while the update function has been called.
Current Behavior
If you update options before data, an error occurs.
Steps to Reproduce
The error was found by one of the wrapper users. I will add a link, maybe this will give you more data for analysis.
xr0master/chartjs-react#10
https://codesandbox.io/s/damp-surf-znpnz
This playground uses a wrapper, but it doesn't really matter. The important thing is that if you update data and then the options, the bug with the axes does not occur. Two different versions of the wrapper are used to show the issue: [options, data], [data, options].
Environment
Thanks for @ace-han investigation