Skip to content

Comments

Enhanced version of sprucegum's legend feature for line charts#18

Open
luebbert42 wants to merge 2 commits intoKilian:masterfrom
luebbert42:master
Open

Enhanced version of sprucegum's legend feature for line charts#18
luebbert42 wants to merge 2 commits intoKilian:masterfrom
luebbert42:master

Conversation

@luebbert42
Copy link

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 ;-)

based on previous work from sprucegum https://github.com/sprucegum
enable with drawlegend: true, optional legend_title: "My Legend"
@Kilian
Copy link
Owner

Kilian commented Aug 11, 2011

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 :)

@luebbert42
Copy link
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants