Skip to content

How to define a custom on_hover behavior for a BarChart - is it really needed to re-implement all of PlotItem? #106

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

Open
markusdd opened this issue May 4, 2025 · 4 comments

Comments

@markusdd
Copy link

markusdd commented May 4, 2025

Currently it only seems possible to provide a custom String to content_formatter to change
what is written when hovering over a bar. But depending on the graph this is often not very well readable.

I'd much rather display a small Box similar to the legend to give more info about the current Bar in the BarChart.

I'm kind of pulling my hair out on this one and have not found a proper solution.

EDIT: A special problem seems to be that I cannot even re-implement PlotItem because for base and mut_base methods to be implemented, I need to use the Type PlotItemBase whcih is inaccesible as the items module is private. I am really stuck here :(
And that is even more frustrating because they are just returning the same as the original implementation anyway. I don't want to do anything special there...

@bircni
Copy link
Contributor

bircni commented May 4, 2025

maybe this helps you?
#76

@markusdd
Copy link
Author

markusdd commented May 4, 2025

I'm probably misunderstanding this, but how exactly would that help?^^

https://github.com/markusdd/rusty_meter it's about my app there.

Image

If you look at the Histogram you see when hovering I have customized the displayed values. But I want this to be displayed in a box similar to Legend when hovering over the bars. Because depending on the bar colour this current implementation can be very hard to read.

@bircni
Copy link
Contributor

bircni commented May 4, 2025

oh I see yeah maybe if you could add something like that - this would be nice

@markusdd
Copy link
Author

markusdd commented May 4, 2025

Yeah that would be really nice indeed, but that is kind of the point of the ticket, I do not really see how 😅

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