diff --git a/frontend/src/components/Charts.js b/frontend/src/components/Charts.js index b2145827..ae4a0995 100644 --- a/frontend/src/components/Charts.js +++ b/frontend/src/components/Charts.js @@ -6,35 +6,33 @@ import styled from 'styled-components'; import { PieChart, Pie, Cell, Legend, Tooltip } from 'recharts'; import { REACT_APP_BACKEND_URL } from '../config'; -// Styled Components const Container = styled.div` display: flex; - flex-direction: column; /* Stack charts vertically */ - align-items: flex-start; /* Center charts horizontally */ - margin-top: 28px; + flex-direction: column; + margin: 20px auto; box-sizing: border-box; + //width: 100%; `; const Title = styled.h2` text-align: center; - align-self: center; margin-bottom: 10px; `; -const Header = styled.h2` - text-align: center; - margin-bottom: 6px; +const Header = styled.h3` + margin-bottom: 8px; + color: #4a4a4a; + padding-bottom: 4px; `; const ChartWrapper = styled.div` - background-color: black; padding: 20px; - border-radius: 20px; - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); + border-radius: 6px; + border: 1px solid #ddd; display: flex; justify-content: center; - align-items: center; - margin-bottom: 30px; /* Space between charts */ + margin-bottom: 30px; + flex-direction: column; `; const GitHubContributionsChart = ({ applicationsByDay }) => { @@ -46,7 +44,14 @@ const GitHubContributionsChart = ({ applicationsByDay }) => { }).reverse(); return ( -
+
{days.map((day) => { const applications = applicationsByDay[day] || 0; const color = applications > 0 ? `rgba(57, 211, 83, ${Math.min(applications / 3, 1)})` : 'rgba(22, 28, 34, 1)'; // Adjust the divisor for color intensity @@ -54,15 +59,14 @@ const GitHubContributionsChart = ({ applicationsByDay }) => {
- {/* Display day of the month */} { }}> {new Date(day).getDate()} - {/* Display month name on the first box of each week */} {day.endsWith('01') && ( { const COLORS = ['#0088FE', '#00C49F', '#FFBB28', '#FF8042', '#FF6384', '#36A2EB', '#FFCE56']; return ( - -
{/* Fixed width for the pie chart */} - + + + { ))} -
+
); }; @@ -167,18 +170,14 @@ const Charts = () => { return ( Your Stats -
Total Applications: {totalApplications}
+
{totalApplications} Job Applications in the last year
- +
Positions
- - - - - +
); };