Draw the rightmost grid line when offsetGridLines is true#6326
Merged
etimberg merged 5 commits intochartjs:masterfrom Jul 18, 2019
Merged
Draw the rightmost grid line when offsetGridLines is true#6326etimberg merged 5 commits intochartjs:masterfrom
etimberg merged 5 commits intochartjs:masterfrom
Conversation
Contributor
|
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. |
etimberg
previously approved these changes
Jun 9, 2019
kurkle
previously approved these changes
Jun 12, 2019
benmccann
reviewed
Jun 12, 2019
kurkle
previously approved these changes
Jun 23, 2019
benmccann
reviewed
Jun 23, 2019
benmccann
previously approved these changes
Jun 24, 2019
Contributor
benmccann
left a comment
There was a problem hiding this comment.
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
Contributor
Author
|
@benmccann I like that idea. It will give some performance improvement if either grid lines or labels are hidden. |
benmccann
previously approved these changes
Jun 26, 2019
Contributor
|
@nagix lgtm, but this PR will need to be rebased |
etimberg
previously approved these changes
Jul 16, 2019
Contributor
Author
|
Rebased |
benmccann
approved these changes
Jul 17, 2019
etimberg
approved these changes
Jul 18, 2019
This was referenced Apr 14, 2020
exwm
pushed a commit
to exwm/Chart.js
that referenced
this pull request
Apr 30, 2021
* Draw the rightmost grid line when offsetGridLines is true * Refactor based on feedback * Replace helpers.each with for loop * Minor refactoring * Refactor _computeItemsToDraw
This was referenced Jun 1, 2021
Open
This was referenced Jul 5, 2021
This was referenced Jul 27, 2021
This was referenced Oct 14, 2021
1 task
This was referenced Jan 21, 2022
This was referenced Feb 4, 2022
This was referenced Mar 7, 2022
Open
1 task
This was referenced Nov 29, 2022
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this PR, the rightmost grid line in bar charts, where
offsetandgridLines.offsetGridLinesaretrueby default, will be drawn. It also fixes the following minor issue.gridLines.coloris 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