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

[Feature Request] Ability to replace LineTouchTooltipData widget #1612

Open
NotTsunami opened this issue Mar 18, 2024 · 5 comments
Open

[Feature Request] Ability to replace LineTouchTooltipData widget #1612

NotTsunami opened this issue Mar 18, 2024 · 5 comments

Comments

@NotTsunami
Copy link

NotTsunami commented Mar 18, 2024

Is your feature request relasted to a problem? Please describe.
SideTitles() allows the user to override the titles widget with practically anything they want, making the axis titles very flexible and extendable as needed, but I have some use cases where I would like to stylize the tooltip created by LineTouchTooltipData().

More specifically, I'd like to be able to stylize the container or even extend functionality of the tooltip widget. Currently I am working with some signal processing, and I'd like to be able to extend the tooltip to add left/right arrows to move a marker to the previous or next peaks in the signal, respectively. We draw the tooltips above the chart using the showOnTopOfTheChartBoxArea property of LineTouchTooltipData, but we would like to extend the functionality of the tooltips.

Describe the solution you'd like
It would be fantastic if we could change the function getTooltipItems from {List<LineTooltipItem?> Function(List<LineBarSpot>)} to something like {Widget Function(LineBarSpot) getTitlesWidget = defaultGetTooltipItems}.

@leonidlist
Copy link

+1, also have a case where I'd like to use a Widget instead of String value

@Selnikhin
Copy link

+1

@Ramzes5614
Copy link

Ramzes5614 commented Mar 19, 2024

+1
Guys, thanks for the great package. We would also like to see this feature

@NotTsunami
Copy link
Author

I realize this might be a larger task since it looks like the library is rendering the tooltips with the Canvas API, which doesn't directly support rendering widgets (correct me if I am wrong), so this might require a larger refactor to move the tooltips to an OverlayEntry.

@imaNNeo
Copy link
Owner

imaNNeo commented Apr 15, 2024

I realize this might be a larger task since it looks like the library is rendering the tooltips with the Canvas API, which doesn't directly support rendering widgets (correct me if I am wrong), so this might require a larger refactor to move the tooltips to an OverlayEntry.

Yes, exactly you're correct.
We need to use Overlays API to draw our tooltips, this way we can use widgets.
But it is a huge work, I would be happy if you could contribute to the project.
You can also sponsor this project to help me work more.

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

5 participants