-
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
feature: legend navigation #11825
Open
adrianbrs
wants to merge
10
commits into
chartjs:master
Choose a base branch
from
adrianbrs:feature/legend-navigation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feature: legend navigation #11825
Conversation
This file contains 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
LeeLenaleee
reviewed
Aug 8, 2024
LeeLenaleee
reviewed
Aug 8, 2024
LeeLenaleee
reviewed
Aug 8, 2024
etimberg
reviewed
Aug 13, 2024
test/fixtures/plugin.legend/navigation/legend-navigation-horizontal-multiple-lines.json
Show resolved
Hide resolved
- Add legend pagination as an optional feature - Fix multiline legend overlap in horizontal positioning - Fix legend title left and right padding not working - Fix legend title overlapping with multiple lines
The navigation object was being populated even with navigation disabled. Now, the navigation object is only initialized if the feature is enabled. Some improvements have also been made to code readability.
adrianbrs
force-pushed
the
feature/legend-navigation
branch
from
August 24, 2024 03:27
8c48a25
to
ed36d56
Compare
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.
I needed this feature to manage many legends on the same chart, but I couldn't find anything besides the HTML legends. Therefore, I decided to implement this feature, and I hope it can be useful for the Chart.js core, as I believe it is essential.
An example of the navigation working, and also the documentation created, can be found here: https://cerbaro.dev/Chart.js/samples/legend/navigation.html
Furthermore, during the process I encountered some issues and ended up solving them.
#11280 - Horizontal padding of the legend title does not work
#11824 - Horizontal legend multiline labels overlaps
I am willing to collaborate with any changes you deem necessary.
Issues related to legend pagination: #10893, #7100, #6545, #3761, #5561, #11425 (There's probably others as well).
There is an open issue for a refactor in the legend plugin (#9342), but I don't know when version 5 will be released, perhaps it would be interesting to add this navigation to the current version anyway.
I would be happy to contribute to the new version if needed.