Skip to content

Commit 5f66025

Browse files
fix(charts): stabilize layout to resolve dimension warnings
1 parent 39e0836 commit 5f66025

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/components/pages/landing/hero-chart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function HeroChart() {
3939
return (
4040
<ChartContainer
4141
config={chartConfig}
42-
className="h-full min-h-[200px] w-full"
42+
className="min-h-0 min-w-0"
4343
>
4444
<ComposedChart
4545
data={chartData}

src/components/ui/chart.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ const ChartContainer = React.forwardRef<
5353
ref={ref}
5454
className={cn(
5555
"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
56+
"min-h-0 min-w-0",
5657
className
5758
)}
5859
{...props}
5960
>
6061
<ChartStyle id={chartId} config={config} />
61-
<RechartsPrimitive.ResponsiveContainer>
62+
<RechartsPrimitive.ResponsiveContainer width="100%" height="100%">
6263
{children}
6364
</RechartsPrimitive.ResponsiveContainer>
6465
</div>

0 commit comments

Comments
 (0)