-
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
Dynamically updating ticks.mirror not working since 2.6 #5129
Comments
@dibsyjr1 does the mirrored display issue only happen when dynamically updating? or does it happen when |
This may have been fixed in #4198 |
@etimberg only when dynamically updating them. If you set it in the options prior to creating the chart it works fine. Excellent, from the looks of it this should solve my problem. Thanks |
Ahhhh yes, that is the issue, when I update ticks.minor.mirror instead of ticks.mirror it works as expected. Thanks @simonbrunel |
Closing as duplicate of #4896 |
In my project i've had a piece of code that's called onResize of the chart to determine whether or not the ticks should be shown on the inside of the chart in order to preserve space on smaller screens. This was working absolutely fine and I hadn't noticed it was broken until just recently, but i've reverted back to Chart.js 2.6 in order to test whether or not it was a fault in Chart.js or in the code i've written and it seems to be 2.7 onwards that the bug occurs.
It seems that now when I try to dynamically set ticks.mirror Chart.js seems to hide my ticks altogether instead of mirroring them. This might be to do with draw area as well because when I don't hide the scale label, but set mirror to true, the labels just get overlapped with the scale label outside of the chart area.
I am only mirroring the y-axis, the x-axis ticks are getting hidden, which is working as expected.
Unmirrored:
Mirrored - Chart.js 2.6.0:
Mirrored - Chart.js 2.7.0/2.7.1 (affects both):
This only seems to be an issue when dynamically updating the property as well, as hardcoding it on chart creation seems to work fine.
The text was updated successfully, but these errors were encountered: