From d847f17f39fdefd04feb3223f7d1e9b993d7820a Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 30 Sep 2024 15:30:18 +0100 Subject: [PATCH] FIX THE PLAYER CHART RESIZING YESSSSSSSSSSSSSSSSSSSSSSSSSSSSS --- src/app/layout.tsx | 4 +--- src/components/player/player-rank-chart.tsx | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 93a0069..f736dc4 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -69,9 +69,7 @@ export default function RootLayout({ }>) { return ( - + diff --git a/src/components/player/player-rank-chart.tsx b/src/components/player/player-rank-chart.tsx index e42ea0e..24039ac 100644 --- a/src/components/player/player-rank-chart.tsx +++ b/src/components/player/player-rank-chart.tsx @@ -16,6 +16,7 @@ import { Line } from "react-chartjs-2"; import ScoreSaberPlayer from "@/common/model/player/impl/scoresaber-player"; import { getDaysAgo, parseDate } from "@/common/time-utils"; import { useIsMobile } from "@/hooks/use-is-mobile"; +import { useEffect } from "react"; Chart.register( LinearScale, @@ -276,7 +277,7 @@ export default function PlayerRankChart({ player }: Props) { const options: any = { maintainAspectRatio: false, - aspectRatio: 1, + responsive: true, interaction: { mode: "index", intersect: false, @@ -314,9 +315,9 @@ export default function PlayerRankChart({ player }: Props) { }; return ( -
+