LineChart, BarChart, PieChart, etc. Tooltips are unusable on mobile
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 41
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 16
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
https://github.com/huntabyte/shadcn-svelte/issues/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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked layerchart Columns example and the shadcn-svelte chart reproduction, then review the related shadcn-svelte issue about the custom PopoverTooltip. The work is done when chart interactions on mobile provide a usable popover by default without requiring a long press or causing text selection and tooltip collapse.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- d3, typescript
- Domain
- data-visualization, frontend, mobile-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100