-
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
Ensure that controllers derived from the bar controller work correct in stacked charts #9587
Conversation
@shubham242k There is also this one: https://github.com/chartjs/Chart.js/blob/master/src/core/core.datasetController.js#L132 UPDATED: This is a different issue, therefore it's not related to this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working fine now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine now anyone can check again
I tested these changes and they fix:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test would be good, but I'm not sure how that could be done.
I have tried to add the test case where I can put canvas inside a small size div for testing overlapping issues , But did not find a way |
Issue Fixes #9569 and fixes #9595
What was the Issue?
when deriving a new chart type by extending
BarController
and using the default functionality of the defaultbar
chart type, the bars are overlapping in a small space.Unexpected behaviour: https://codesandbox.io/s/unexpected-behaviour-yiy8y?file=/src/index.js
Expected behaviour:
Changes Made
changes the argument passed in
getMatchingVisibleMetas
Chart.js/src/controllers/controller.bar.js
Line 9 in fca0309
from
'bar'
tometa._type
.getMatchingVisibleMetas
returns the datasets that are visible and have type equals tometa._type
UPDATE
Also changed the argument passed in 'getMatchingVisibleMetas' at
Chart.js/src/core/core.datasetController.js
Line 132 in fca0309