Skip to content
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

showlegend parameter of piechart should take a list as argument #4671

Open
gvwilson opened this issue Jul 17, 2024 · 0 comments
Open

showlegend parameter of piechart should take a list as argument #4671

gvwilson opened this issue Jul 17, 2024 · 0 comments
Labels
cs customer success feature something new P3 not needed for current cycle

Comments

@gvwilson
Copy link
Contributor

Piecharts can currently only show all legend entries or none. It would be useful, if users could pass a list of booleans as argument to the showlegend parameter. E.g.:

import plotly.graph_objects as go

labels = ['Oxygen','Hydrogen','Carbon_Dioxide','Nitrogen']
values = [4500, 2500, 1053, 500]

# pull is given as a fraction of the pie radius
fig = go.Figure(data=[go.Pie(labels=labels, values=values, pull=[0, 0, 0.2, 0], showlegend=[False, True, True, True])])
fig.show()

Our use case comes from the print area. Here we have three charts with the same legends side by side. To save some space on the page, the legends shouldn't be repeated over and over again. Instead, we show only a third of the legends under the first chart, then the second third of legends under the second chart, etc.

I don't have a strong preference when it comes to the implementation. Pie charts are not very common, so a simple list of booleans might be enough for us, but if you have other preferences this is fine by us. From an design perspective I would consider, that there are already other parameters (like pull) that work based on a list, so using a list seems consistent to me.

To further specify our use case: Ideally we would like to manage the legend entries for each slice of the pie as separate entities. This means it should also be possible to assign them to different legends and customize them accordingly.

@gvwilson gvwilson added the feature something new label Jul 17, 2024
@gvwilson gvwilson self-assigned this Jul 17, 2024
@gvwilson gvwilson added the cs customer success label Jul 17, 2024
@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added the P3 not needed for current cycle label Aug 12, 2024
@gvwilson gvwilson changed the title feat: showlegend parameter of piechart should take a list as argument showlegend parameter of piechart should take a list as argument Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cs customer success feature something new P3 not needed for current cycle
Projects
None yet
Development

No branches or pull requests

1 participant