-
-
Notifications
You must be signed in to change notification settings - Fork 838
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
Changes to yAxisID property does not re-render chart #177
Comments
Hey @feltoar, thanks for the issue. I will have a look into this. However it seems this is an edge case, because Quick Fix for you would be to make your own mixins or add a watcher to the yAxisID and then force a re-render by yourself. I am not sure if this can be implemented in a clean way in the mixins 🤔 But I will have a look. |
Thank you. I have a quick work around already so I am sorted. Thought I would raise the issue anyway just so you were aware. Thank you for bringing ChartJs to Vue! |
Hey @feltoar can you give me some sample data or a jsfiddle/webpackbin/codepen for reproduction? |
closed due to inactivity |
@apertureless, here's a jsfiddle reproducing this issue. Can this bug be re-opened? https://jsfiddle.net/jcushman/xrtmz7ch/12/ The demo chart has a button that switches the two datasets to be displayed on the same scale or separate scales (which is the usecase that led me to this bug). The button only works if the chart is manually re-rendered on click, because dataset.yAxisID is not reactive. |
Expected Behavior
Would like the chart to re-render after a change to the yAxisID property within the dataset. Using the reactiveProp mixin other changes are reflected as expected. This includes new or removed datasets as well as changes to backgroundColor property. For some reason yAxisID does not work in the same way.
I presume this is because chart.update(); works for backgroundColor and not for yAxisID. Quickly hacking the source has allowed me to force re-render on each change which is acceptable for my app, but is not a proper fix. See: hunterwebsiteservices@0847898#diff-24b15a098615f4b31bc5662babd25b49
Same applies for both reactiveProp and reactiveData mixins.
Actual Behavior
Changes to the yAxisID property within the dataset should cause a re-render of the chart, and not an update.
Environment
The text was updated successfully, but these errors were encountered: