Skip to content

[Issue][v3.beta.11] strict order of updating options and data. #8515

Description

@xr0master

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions