-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Single-toggle of grouped traces in legend #3135
Comments
Can I ask why are you using legend groups if you don't want group toggling? I suspect you like the legend group aesthetics, but I'd like to confirm. Thank you! |
@etpinard I have a quiet complex use case, with multiple sub-charts. Each sub-chart has its own legend-group. I'm using sub-charts because I need a common spike-line and synchronized zooming/panning. It is amazing, what is possible with plotly.js already, but I could write small bug-reports and feature requests daily if I had the time... That's the price of using every cutting-edge feature that exists, I guess 😏 |
Thanks!
Please don't hesitate, if you have the time of course 😉 |
This seems like a good idea for what I am doing too, but it is possible there is another way to approach my use case that I haven't seen. |
I have the same issue. To me, the group legend should honor the individual toggling or make it a configurable thing. Without grouping the legend it is difficult to visually make sense of some use cases of combination such as this https://codepen.io/Codermar/pen/NWWrqRB?editors=0010 Is there any workaround alternative at this time otherwise? Thanks. |
I have the same issue too, as I suspect anyone serious about plotting data is having. The current state of play does not permit all three. |
Agree with @mojoaxel, the user needs to be able to toggle on/off an individual trace in a subplot. Maybe the solution will come from first having separate legends per sublot, @OlderSchool suggests. BTW, the separate legends per subplot is an issue that can be tracked here: |
I would suggest a following behaviour: legend group would become an independent toggle with a name of a legendgroup, which would activate/deactivate all contained traces. Yet if someone needs to toggle some particular trace, he can add |
I would summarize the suggestions as follows.
This solution should take care of most use cases and issues relating to legend group title and (scatter/group) toggles, except for the very particular use cases like selectively displaying legend group titles for certain legend groups. |
I certainly understand the desires here but I'll just add a couple of other points of view:
This leaves the actual legend-item click behaviour :) Right now we're not working on any changes, but we would certainly accept a pull-request to control whether or not clicking on an item in a group toggles only that item or the whole group. This could be a global attribute under The idea of having the legend group title be clickable is not something I'd thought of but is a good one, and would be a good candidate for implementation, and for having a non-changeable behaviour of "clicking on it toggles the whole group". |
Our use case could utilize the |
Yes, the use-case here is pretty clear, but I'm not sure when someone from our team will be able to take this on. We'd love a pull request that implements this in a backwards-compatible way i.e. with a new attribute in |
This is a feature request.
Please see default "Grouped Legend" example: https://codepen.io/plotly/pen/qjmNXa
Current behavior
It is possible to toggle single traces by clicking on them in the legend. If traces are grouped using
legendgroup
(like in the example above) not the single traces but the whole group is toggled.Future behavior
It should be possible to disable the toggling of the whole group and instead toggle the single traces like in no-grouped legends. This would make it possible in the example above to only disable the "points" and only show the "avarage line" of this group.
This should be done by a new option in the legend-settings.
Related: #65, #665, #674
The text was updated successfully, but these errors were encountered: