-
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
Draw the rightmost grid line when offsetGridLines is true #6326
Conversation
I think #5480 is trying to do too much in a single PR. It'd be much easier to review if we added the new border functionality and separated the gridline functionality as a plugin in separate PRs, so I'm okay moving forward with this PR separately. |
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.
lgtm.
I might consider splitting _computeItemsToDraw
into _computeGridLineItems
and _computeLabelItems
as it's getting pretty big and it looks like there's essentially no shared code between them. It'd also mean you wouldn't need the extra
variable anymore
@benmccann I like that idea. It will give some performance improvement if either grid lines or labels are hidden. |
@nagix lgtm, but this PR will need to be rebased |
Rebased |
* Draw the rightmost grid line when offsetGridLines is true * Refactor based on feedback * Replace helpers.each with for loop * Minor refactoring * Refactor _computeItemsToDraw
With this PR, the rightmost grid line in bar charts, where
offset
andgridLines.offsetGridLines
aretrue
by default, will be drawn. It also fixes the following minor issue.gridLines.color
is an array but some element is undefined, that line won't be drawn. It should rather be drawn in the default color.I'm aware of #5480 trying to solve this by a new plugin, but there have been many changes in the core scale code since it was opened, and a lot of effort would be needed to rebase it. This PR doesn't prevent to introduce a separate grid line plugin, but proposes a simpler approach to address the issue based on the latest code base.
Master: https://jsfiddle.net/nagix/9ak5L48q/
This PR: https://jsfiddle.net/nagix/dLv84ujs/
Fixes #3804