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

Custom Legend for any chart #1939

Closed
TimTimT opened this issue Feb 26, 2022 · 8 comments
Closed

Custom Legend for any chart #1939

TimTimT opened this issue Feb 26, 2022 · 8 comments
Labels

Comments

@TimTimT
Copy link

TimTimT commented Feb 26, 2022

Is it possible to render legend components on any chart?
Both for the Swarm and Bullet chart, I would like to show my users what the colors and other markings on the chart signify.

Is there a way use the BoxLegendSvg component, feed it custom input, and render the result on a Bullet or SwarmPlot?

@stale
Copy link

stale bot commented May 30, 2022

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the stale label May 30, 2022
@tkonopka
Copy link
Contributor

Legends are available for most charts, but it seems that feature is missing for swarmplot and bullet.

@TimTimT - yes, it is possible to use BoxLegendSvg to manually create a legend. See here an example with swarmplot

https://codesandbox.io/s/clever-bash-9uxctg?file=/src/App.js

For the bullet chart, adding a legend would be more complicated because that implementation does not support custom layers. As a hack, you could create two charts side by side, the first visualizating your data, the second with an empty Bar/Swarm/Other chart and display a legend in the second adjacent chart.

@plouc, I can add legend capability to the swarmplot. It would be nice to have that work without resorting to custom layers.

@TimTimT
Copy link
Author

TimTimT commented Jun 8, 2022

Very useful @tkonopka , Thank you!

@stale
Copy link

stale bot commented Sep 20, 2022

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the stale label Sep 20, 2022
@stale
Copy link

stale bot commented Sep 27, 2022

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@stale stale bot closed this as completed Sep 27, 2022
@ppfm
Copy link

ppfm commented Apr 5, 2023

Bump

@p-abasian
Copy link

bump

@eddy8mame
Copy link

Bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants