Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Make chart responsive

Tim Wilsonf10800b315ef
diff --git a/apps/web/ui/analytics/clicks.tsx b/apps/web/ui/analytics/clicks.tsx
index c870f18098..244029956d 100644
--- a/apps/web/ui/analytics/clicks.tsx
+++ b/apps/web/ui/analytics/clicks.tsx
@@ -23,7 +23,7 @@ export default function Clicks() {
const { queryParams } = useRouterStuff();
return (
- <div className="max-w-4xl border border-gray-200 bg-white p-5 sm:rounded-lg sm:border-gray-100 sm:p-10 sm:shadow-lg">
+ <div className="max-w-4xl overflow-hidden border border-gray-200 bg-white p-5 sm:rounded-lg sm:border-gray-100 sm:p-10 sm:shadow-lg">
<div className="mb-5 flex items-start justify-between space-x-4">
<div className="flex-none">
<div className="flex items-end space-x-1">
diff --git a/apps/web/ui/charts/time-series-chart.tsx b/apps/web/ui/charts/time-series-chart.tsx
index 037f1e8196..cebe46b977 100644
--- a/apps/web/ui/charts/time-series-chart.tsx
+++ b/apps/web/ui/charts/time-series-chart.tsx
@@ -102,7 +102,7 @@ function TimeSeriesChartInner<T extends Datum>({
}, [startDate, endDate, minY, maxY, height, width, margin]);
const { maxTicks, xTickInterval } = useMemo(() => {
- const maxTicks = maxTicksProp ?? width < 450 ? 6 : width < 900 ? 8 : 12;
+ const maxTicks = maxTicksProp ?? width < 500 ? 6 : width < 800 ? 8 : 12;
const xTickInterval =
factors(data.length).find((f) => data.length / f < maxTicks) ?? 1;