Skip to content

Commit 1a2b999

Browse files
fix(webapp): constrain usage chart height to 320px
The UsageChart was using Chart.Root with minHeight='160px' but no max height constraint. The ChartContainer base class includes aspect-video (16:9 ratio), causing the chart to expand based on viewport width — often filling the entire screen. Before PR #2905, the chart used ChartContainer directly with 'max-h-96 min-h-40 w-full'. The migration to Chart.Root lost the max-height constraint. Fix: wrap Chart.Root in a fixed-height container (h-80 = 320px) and use fillContainer prop, which applies !aspect-auto to override the aspect-video ratio. Co-Authored-By: nick <55853254+nicktrn@users.noreply.github.com>
1 parent 99dfee3 commit 1a2b999

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.usage

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.usage/route.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -311,19 +311,21 @@ function UsageChart({ data }: { data: UsageSeriesData }) {
311311
);
312312

313313
return (
314-
<Chart.Root
315-
config={chartConfig}
316-
data={data}
317-
dataKey="date"
318-
showLegend={false}
319-
enableZoom={false}
320-
minHeight="160px"
321-
>
322-
<Chart.Bar
323-
xAxisProps={{ tickFormatter: xAxisTickFormatter }}
324-
yAxisProps={{ tickFormatter: yAxisTickFormatter, allowDecimals: true }}
325-
tooltipLabelFormatter={tooltipLabelFormatter}
326-
/>
327-
</Chart.Root>
314+
<div className="h-80">
315+
<Chart.Root
316+
config={chartConfig}
317+
data={data}
318+
dataKey="date"
319+
showLegend={false}
320+
enableZoom={false}
321+
fillContainer
322+
>
323+
<Chart.Bar
324+
xAxisProps={{ tickFormatter: xAxisTickFormatter }}
325+
yAxisProps={{ tickFormatter: yAxisTickFormatter, allowDecimals: true }}
326+
tooltipLabelFormatter={tooltipLabelFormatter}
327+
/>
328+
</Chart.Root>
329+
</div>
328330
);
329331
}

0 commit comments

Comments
 (0)