-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[BUG] scales undefined when update options with a new object #4197
Comments
@xg-wang the issue here is that you need to provide an ID for the axis that is updating. Once we get to the next major version this will be clearer because we'll change from an array of axes to map of ID -> axis but until then this is required. |
@etimberg The IDs are set when merging the user input options with Even if I add a field of id to the new option, other default properties are still missing. |
@etimberg I'm not sure should we allow this, but I noticed the testcase for tooltip is passing in a new config object and passing the testcase. The PR #4198 could allow new object as new config. So this is not a bug but a convention of updating the config. Should the PR be merged? |
Sorry, I was away for the weekend and just had a chance to look at this. I think it should be fine to replace the tooltip options object as the test case does. It's just that the way axes are structured as an array makes it hard. @simonbrunel thoughts? |
Done in #4198 |
Expected Behavior
Be able to call
chart.update()
after setting new options related to scales.Current Behavior
Possible Solution
It's caused by setting scales in new options to chart.scales directly. Could be fixed by merging with default values and ensureScalesHaveIDs before doing so. Have worked out a PR.
Reproduce
Codepen
Context
When I want to change the tick display format of axes it broke.
The text was updated successfully, but these errors were encountered: