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

Setting Legend Markers using Paths #941

Open
febkor opened this issue Apr 15, 2024 · 1 comment
Open

Setting Legend Markers using Paths #941

febkor opened this issue Apr 15, 2024 · 1 comment

Comments

@febkor
Copy link

febkor commented Apr 15, 2024

Thanks for the great library :)

I'm currently using uPlot to draw plots with custom markers, e.g. triangles, squares, stars etc, like done in this demo.
It would be useful for users to see these markers in the legend.

If I'm not missing something, it seems the current uPlot api does not allow setting a canvas Path in the legend and relies primarily on CSS for styling the legend markers.

Would it be possible to add something like this to the API?

Alternatives I'm aware of:

  • maintaining my own legend div (like Grafana)
  • setting the u-marker div once uPlot has finished drawing
  • using emoji shapes in the u-label div
  • drawing these markers using CSS

These options all seem like (possibly hacky) workarounds.
Are there any other reasonable options?

@leeoniya
Copy link
Owner

leeoniya commented May 3, 2024

i think you've listed all the options :)

option 1 is probably not very good if all you need it to customize markers.

there's an issue open for this, but it's kinda backlogged: #431

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

No branches or pull requests

2 participants