-
-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Problem
On mobile, when users tap on bars/lines on mobile, they need to hold down on the bar/line to see the tooltip. If they hold down for too long, it will begin highlighting the surrounding text and collapse the tooltip. This makes using the graphs on mobile unusable.
I looked through the layerchart docs and was unable to find any examples that had the popover UX on mobile.
Ideal UX
As described in other issues, Tooltips are not intended to be used for mobile. Instead, we should use Popovers.
ReCharts in Shadcn and Unovis implement this behavior natively:
https://ui.shadcn.com/charts/bar#charts
However, it's not clear on how to implement this in layerchart natively or within Svelte Shadcn
Reproduce Issue
Go to these on your phone:
(Shadcn-Svelte uses layerchart)
https://shadcn-svelte.com/charts/bar#charts
https://www.layerchart.com/docs/examples/Columns
What I Tried
huntabyte/shadcn-svelte#1044
Solutions here with a custom PopoverTooltip component didn't render the popover when using it as a tooltip snippet
Desired Solution
A way to default to Popover behavior on mobile.