Skip to content

Commit

Permalink
responsive graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
layanmoyura committed Feb 14, 2025
1 parent e518481 commit b0f628e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const geistMono = Geist_Mono({
});

export const metadata: Metadata = {
title: "Create Next App",
title: "Letterboxd Stats",
description: "Generated by create next app",
};

Expand Down
8 changes: 6 additions & 2 deletions src/components/LetterboxdDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useState } from 'react';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip } from 'recharts';
import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from 'recharts';
import { Film, Star, Calendar } from 'lucide-react';

const LetterboxdStats = () => {
Expand Down Expand Up @@ -189,13 +189,15 @@ const LetterboxdStats = () => {
<CardTitle>Rating Distribution</CardTitle>
</CardHeader>
<CardContent>
<ResponsiveContainer width="100%" height={200}>
<BarChart width={300} height={200} data={stats.ratingDistribution}>
<CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="rating" />
<YAxis />
<Tooltip />
<Bar dataKey="count" fill="#8884d8" />
</BarChart>
</ResponsiveContainer>
</CardContent>
</Card>

Expand All @@ -204,13 +206,15 @@ const LetterboxdStats = () => {
<CardTitle>Watches by Month</CardTitle>
</CardHeader>
<CardContent>
<BarChart width={300} height={200} data={stats.watchesByMonth}>
<ResponsiveContainer width="100%" height={200}>
<BarChart data={stats.watchesByMonth}>
<CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="month" />
<YAxis />
<Tooltip />
<Bar dataKey="count" fill="#82ca9d" />
</BarChart>
</ResponsiveContainer>
</CardContent>
</Card>

Expand Down

0 comments on commit b0f628e

Please sign in to comment.