Enhanced version of sprucegum's legend feature for line charts#18
Open
luebbert42 wants to merge 2 commits intoKilian:masterfrom
Open
Enhanced version of sprucegum's legend feature for line charts#18luebbert42 wants to merge 2 commits intoKilian:masterfrom
luebbert42 wants to merge 2 commits intoKilian:masterfrom
Conversation
based on previous work from sprucegum https://github.com/sprucegum enable with drawlegend: true, optional legend_title: "My Legend"
Owner
|
Hi Luebbert42! Cool! I'm quite busy right now so it might be a couple of days before I can look into this, but I'll get around to it :) |
Author
|
Hi Kilian, most probably I will modify this feature again (I need an option to set the legend in another corner of the chart). I'll keep you up to date. Dorthe |
legend_position_x can be either 'left' or 'right' ('right' = default)
legend_position_y can be either 'top' or 'bottom' ('bottom' = default)
By setting those two variables the legend can be drawn in a corner of your choice.
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.
Hi,
I needed this feature as well, but figured out that there is an issue with longer titles (they were not positioned correctly each under another, so I fixed this (*)).
I also moved the drawLegend function to the linechart class and added an option to set the text for the legend. Legends are off by default.
How can I use this feature?
enable the legend with:
drawlegend: true,
legend_title: "My Legend", // fallback is "Legend: "
Regards
Dorthe
(*) Pls be patient with me, this is my first pull request on github, I hope I did everything in a correct way, it's a bit spooky ;-)