plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
16.95k stars 1.86k forks source link

Multiple legends: trace.legend and layout.legend<N> #5098

Closed nicolaskruchten closed 1 year ago

nicolaskruchten commented 4 years ago

Breaking off of https://github.com/plotly/plotly.js/issues/1668 ...

Multiple users have requested what amounts to the ability to have multiple legends, within the current concept of "each trace has a single legend item which appears in a single legend". This could be implemented by adding a legend attribute to each trace that would operate similarly to the xaxis attribute, and a corresponding legend2, legend3 series of attributes in the layout. This is distinct from the idea of having a legend for size and one for symbol etc, as in that case each item would refer to multiple traces, and each trace would be represented by multiple items.

The major challenge here is the default positioning of legend2 if present... we could do something really ugly like just having it default to the position of the first legend and forcing users to position them manually, but having it "stick to the bottom" is probably a much more graceful solution, if more complex to implement.

nicolaskruchten commented 4 years ago

It's a good feature and we'd love to have it in the library but it's not on anyone's roadmap at the moment as far as I know. That said, we as maintainers would be happy to help someone from the community to implement it in Plotly.js, or to accept sponsorship to get it on to our short-term roadmap :)

nicolaskruchten commented 4 years ago

This issue has been tagged with NEEDS SPON$OR

A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort.

Sponsorship range: $10k-$15k

What Sponsorship includes:

Please include the link to this issue when contacting us to discuss.

Episkiliski commented 3 years ago

Any plan to work on this issue?

nicolaskruchten commented 3 years ago

We'd love to, given a sponsor :)

seungy0 commented 3 years ago

Is this going on right now?

nicolaskruchten commented 3 years ago

We're still looking for a sponsor, and will update this issue when we find one :)