Replies: 1 comment 6 replies
-
Have you solved it? I have the same problem. The chart won't take the ratio of it's parent. It either overflows or makes the parent scrollable. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
using the radial chart - stacked example, it's constrained to a square container: https://v0.dev/chat/D3w3SS1Usyu?b=b_1UyZynWT5HP
i have a grid of three in a row and i'm struggling to make them actually responsive. instead, they're stuck in their fixed svg viewbox and get cut off, or get stuck in their aspect ratio. the closest i've gotten is making the grid container have a fixed height, set aspect-square, then set a high enough maximum size so that there's enough padding on top.
chrome_iFdfHwU4pC.mp4
removing the fixed parent container height then:
setting
w-full aspect-auto min-h-30
results in a chart with 0 heightsetting
w-full min-h-30
, so defaulting toaspect-video
results in whatever this is:chrome_9BYLiyqIwX.mp4
setting the minimum height doesn't actually do much either.
min-h-30
is functionally the same asmin-h-3
somehow. its only until i setmin-h-36
it overflows out the side.i realize this is just a skill issue in how svg viewboxes and recharts work, but nothing about this is responsive at all. i've looked through a bunch of the hacks provided in recharts/recharts#172 to no avail. what's the solution here?
Beta Was this translation helpful? Give feedback.
All reactions