-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add option to explicitly set chart legend position #4865
Conversation
@arikfr Please lmk if I'm on the right direction and feel free to share your ideas. Thank you! |
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.
We should have only two options:
- To the right of the chart with auto behavior like today. I don't see why the user would want it otherwise.
- To the bottom of the chart.
I also experimented with other options, like placing legend above the plot, but that wasn't easy to implement (conflicted with modebar), so I abandoned this idea. |
Is it easy to add an option of "inside the chart"? (regardless of whether it's overlapping or not) |
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.
Just a change to the option names to make them friendlier to users. Up to you if you want to change the naming in code.
Yes, it's possible. We can even choose anchors (all four corners). Would you like to see how it looks like? Also, WDYT about moving "Show legend" checkbox to dropdown option ("Hide legend" or whatever) - to make UI less crowded? |
I think it's a good idea.
If it's a small effort, then yes - let's do it. But maybe finish this one (with the "hide" in side the same dropdown) and try the new options in a separate PR? Then it will be easier to drop it if we don't like it. |
Okay, I'll move the checkbox to dropdown tomorrow morning (and add spelling fixes you suggested) and we'll finalize work on this PR. Then I'll prepare PR with more options. |
What type of PR is this? (check all applicable)
Description
Add a new option to control legend placement. Existing behavior (next to chart on width >= 600px and below when width < 600px) became "Auto", and added fixed position below the plot.
Related Tickets & Documents
#4852
Mobile & Desktop Screenshots/Recordings (if there are UI changes)