Spaces:
Running
Running
add animations and improve the interface, make it pleasing, comforting to the eye and creative but minimal
094569b verified | <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Analytics | PESO Registry</title> | |
| <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> | |
| <script src="https://cdn.jsdelivr.net/npm/chart.js"> | |
| animateChart(jobStatusChart); | |
| // Add hover effects to all charts | |
| document.querySelectorAll('.chart-container').forEach(container => { | |
| container.addEventListener('mouseenter', function() { | |
| anime({ | |
| targets: this, | |
| scale: 1.02, | |
| duration: 300, | |
| easing: 'easeOutQuad' | |
| }); | |
| }); | |
| container.addEventListener('mouseleave', function() { | |
| anime({ | |
| targets: this, | |
| scale: 1, | |
| duration: 300, | |
| easing: 'easeOutQuad' | |
| }); | |
| }); | |
| }); | |
| }); | |
| </script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| <style> | |
| :root { | |
| --mint-green: #98FF98; | |
| --mint-dark: #79C779; | |
| --mint-light: #D1FFD1; | |
| --mint-transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); | |
| } | |
| .sidebar { | |
| background: linear-gradient(135deg, rgba(152, 255, 152, 0.95) 0%, rgba(121, 199, 121, 0.95) 100%); | |
| min-height: 100vh; | |
| transition: var(--mint-transition); | |
| box-shadow: 5px 0 15px rgba(0,0,0,0.05); | |
| backdrop-filter: blur(5px); | |
| } | |
| .sidebar-link { | |
| color: #333; | |
| border-radius: 8px; | |
| padding: 12px 20px; | |
| margin-bottom: 8px; | |
| transition: var(--mint-transition); | |
| background: rgba(255,255,255,0.3); | |
| box-shadow: 0 2px 5px rgba(0,0,0,0.05); | |
| } | |
| .sidebar-link:hover, .sidebar-link.active { | |
| background: rgba(255,255,255,0.7); | |
| color: var(--mint-dark); | |
| text-decoration: none; | |
| transform: translateX(5px); | |
| box-shadow: 0 5px 15px rgba(0,0,0,0.1); | |
| } | |
| .sidebar-link i { | |
| margin-right: 10px; | |
| } | |
| .card { | |
| border-radius: 16px; | |
| box-shadow: 0 8px 25px rgba(0,0,0,0.05); | |
| transition: var(--mint-transition); | |
| border: none; | |
| overflow: hidden; | |
| background: rgba(255,255,255,0.9); | |
| backdrop-filter: blur(5px); | |
| } | |
| .card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 15px 30px rgba(121, 199, 121, 0.2); | |
| } | |
| .btn-mint { | |
| background: linear-gradient(135deg, var(--mint-green) 0%, var(--mint-dark) 100%); | |
| border: none; | |
| color: white; | |
| border-radius: 50px; | |
| padding: 10px 24px; | |
| font-weight: 500; | |
| box-shadow: 0 4px 15px rgba(121, 199, 121, 0.3); | |
| transition: var(--mint-transition); | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .btn-mint:hover { | |
| transform: translateY(-3px); | |
| box-shadow: 0 8px 20px rgba(121, 199, 121, 0.4); | |
| color: white; | |
| } | |
| .btn-mint:active { | |
| transform: translateY(0); | |
| } | |
| .btn-mint::after { | |
| content: ''; | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent); | |
| transform: translateX(-100%); | |
| transition: 0.6s; | |
| } | |
| .btn-mint:hover::after { | |
| transform: translateX(100%); | |
| } | |
| .chart-container { | |
| position: relative; | |
| height: 250px; | |
| width: 100%; | |
| transition: var(--mint-transition); | |
| } | |
| .chart-container:hover { | |
| transform: scale(1.02); | |
| } | |
| @keyframes fadeIn { | |
| from { opacity: 0; transform: translateY(20px); } | |
| to { opacity: 1; transform: translateY(0); } | |
| } | |
| .tab-pane { | |
| animation: fadeIn 0.6s ease-out forwards; | |
| } | |
| .card-header { | |
| border-bottom: 1px solid rgba(0,0,0,0.05); | |
| background: rgba(255,255,255,0.7); | |
| } | |
| .dropdown-menu { | |
| border-radius: 12px; | |
| box-shadow: 0 10px 25px rgba(0,0,0,0.1); | |
| border: none; | |
| overflow: hidden; | |
| } | |
| .nav-pills .nav-link { | |
| transition: var(--mint-transition); | |
| border-radius: 50px; | |
| padding: 10px 24px; | |
| color: #6c757d; | |
| } | |
| .nav-pills .nav-link.active { | |
| background: linear-gradient(135deg, var(--mint-green) 0%, var(--mint-dark) 100%); | |
| color: white; | |
| box-shadow: 0 5px 15px rgba(121, 199, 121, 0.3); | |
| transform: translateY(-2px); | |
| } | |
| .nav-pills .nav-link:not(.active):hover { | |
| background: rgba(121, 199, 121, 0.1); | |
| color: var(--mint-dark); | |
| } | |
| .profile-img { | |
| transition: var(--mint-transition); | |
| box-shadow: 0 5px 15px rgba(0,0,0,0.1); | |
| border: 3px solid white; | |
| } | |
| .profile-img:hover { | |
| transform: scale(1.05) rotate(5deg); | |
| box-shadow: 0 10px 25px rgba(0,0,0,0.2); | |
| } | |
| @keyframes pulse { | |
| 0%, 100% { transform: scale(1); } | |
| 50% { transform: scale(1.05); } | |
| } | |
| .h2 { | |
| position: relative; | |
| display: inline-block; | |
| } | |
| .h2::after { | |
| content: ''; | |
| position: absolute; | |
| bottom: -5px; | |
| left: 0; | |
| width: 50px; | |
| height: 3px; | |
| background: linear-gradient(90deg, var(--mint-green), var(--mint-dark)); | |
| border-radius: 3px; | |
| transition: var(--mint-transition); | |
| } | |
| .h2:hover::after { | |
| width: 100%; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container-fluid"> | |
| <div class="row"> | |
| <!-- Sidebar (same as admin-dashboard.html) --> | |
| <div class="col-md-3 col-lg-2 d-md-block sidebar bg-light collapse show" id="sidebarMenu"> | |
| <div class="position-sticky pt-3"> | |
| <div class="text-center mb-4"> | |
| <img src="http://static.photos/people/200x200/43" alt="Profile" class="rounded-circle profile-img mb-2"> | |
| <h5>Admin User</h5> | |
| <p class="text-muted small">Administrator</p> | |
| </div> | |
| <ul class="nav flex-column"> | |
| <li class="nav-item"> | |
| <a class="nav-link sidebar-link" href="admin-dashboard.html"> | |
| <i data-feather="home"></i> Dashboard | |
| </a> | |
| </li> | |
| <li class="nav-item"> | |
| <a class="nav-link sidebar-link" href="admin-clients.html"> | |
| <i data-feather="users"></i> Client Registry | |
| </a> | |
| </li> | |
| <li class="nav-item"> | |
| <a class="nav-link sidebar-link" href="admin-jobs.html"> | |
| <i data-feather="briefcase"></i> Job Management | |
| </a> | |
| </li> | |
| <li class="nav-item"> | |
| <a class="nav-link sidebar-link" href="admin-services.html"> | |
| <i data-feather="settings"></i> Services | |
| </a> | |
| </li> | |
| <li class="nav-item"> | |
| <a class="nav-link sidebar-link active" href="admin-analytics.html"> | |
| <i data-feather="pie-chart"></i> Analytics | |
| </a> | |
| </li> | |
| <li class="nav-item mt-3"> | |
| <a class="nav-link sidebar-link text-danger" href="index.html"> | |
| <i data-feather="log-out"></i> Logout | |
| </a> | |
| </li> | |
| </ul> | |
| </div> | |
| </div> | |
| <!-- Main content --> | |
| <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4 py-4"> | |
| <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3"> | |
| <h1 class="h2" style="background: linear-gradient(45deg, var(--mint-dark), var(--mint-green)); -webkit-background-clip: text; -webkit-text-fill-color: transparent;"> | |
| <i data-feather="pie-chart" class="me-2"></i>Analytics Dashboard | |
| </h1> | |
| <div class="btn-toolbar mb-2 mb-md-0"> | |
| <div class="btn-group me-2"> | |
| <button type="button" class="btn btn-sm btn-outline-secondary"> | |
| <i data-feather="download"></i> Export | |
| </button> | |
| </div> | |
| <div class="dropdown"> | |
| <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown"> | |
| <i data-feather="calendar"></i> This Month | |
| </button> | |
| <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton"> | |
| <li><a class="dropdown-item" href="#">This Week</a></li> | |
| <li><a class="dropdown-item" href="#">This Month</a></li> | |
| <li><a class="dropdown-item" href="#">This Year</a></li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| <ul class="nav nav-pills mb-4 p-3 bg-white rounded-3 shadow-sm" id="analyticsTabs" role="tablist"> | |
| <li class="nav-item" role="presentation"> | |
| <button class="nav-link active" id="demographics-tab" data-bs-toggle="pill" data-bs-target="#demographics" type="button" role="tab">Demographics</button> | |
| </li> | |
| <li class="nav-item" role="presentation"> | |
| <button class="nav-link" id="services-tab" data-bs-toggle="pill" data-bs-target="#services" type="button" role="tab">Services</button> | |
| </li> | |
| <li class="nav-item" role="presentation"> | |
| <button class="nav-link" id="jobs-tab" data-bs-toggle="pill" data-bs-target="#jobs" type="button" role="tab">Jobs</button> | |
| </li> | |
| </ul> | |
| <div class="tab-content" id="analyticsTabsContent"> | |
| <!-- Demographics Tab --> | |
| <div class="tab-pane fade show active" id="demographics" role="tabpanel" aria-labelledby="demographics-tab"> | |
| <div class="row"> | |
| <div class="col-md-6 mb-4"> | |
| <div class="card h-100"> | |
| <div class="card-header"> | |
| <div class="d-flex justify-content-between align-items-center"> | |
| <h5 class="mb-0">Sex Distribution</h5> | |
| <div class="dropdown"> | |
| <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="sexDropdown" data-bs-toggle="dropdown"> | |
| <i data-feather="filter"></i> | |
| </button> | |
| <ul class="dropdown-menu" aria-labelledby="sexDropdown"> | |
| <li><a class="dropdown-item" href="#">This Month</a></li> | |
| <li><a class="dropdown-item" href="#">This Year</a></li> | |
| <li><a class="dropdown-item" href="#">All Time</a></li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="card-body"> | |
| <div class="chart-container"> | |
| <canvas id="sexChart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="col-md-6 mb-4"> | |
| <div class="card h-100"> | |
| <div class="card-header"> | |
| <div class="d-flex justify-content-between align-items-center"> | |
| <h5 class="mb-0">Age Groups</h5> | |
| <div class="dropdown"> | |
| <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="ageDropdown" data-bs-toggle="dropdown"> | |
| <i data-feather="filter"></i> | |
| </button> | |
| <ul class="dropdown-menu" aria-labelledby="ageDropdown"> | |
| <li><a class="dropdown-item" href="#">This Month</a></li> | |
| <li><a class="dropdown-item" href="#">This Year</a></li> | |
| <li><a class="dropdown-item" href="#">All Time</a></li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="card-body"> | |
| <div class="chart-container"> | |
| <canvas id="ageChart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="col-md-6 mb-4"> | |
| <div class="card h-100"> | |
| <div class="card-header"> | |
| <div class="d-flex justify-content-between align-items-center"> | |
| <h5 class="mb-0">Barangay Distribution</h5> | |
| <div class="dropdown"> | |
| <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="barangayDropdown" data-bs-toggle="dropdown"> | |
| <i data-feather="filter"></i> | |
| </button> | |
| <ul class="dropdown-menu" aria-labelledby="barangayDropdown"> | |
| <li><a class="dropdown-item" href="#">This Month</a></li> | |
| <li><a class="dropdown-item" href="#">This Year</a></li> | |
| <li><a class="dropdown-item" href="#">All Time</a></li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="card-body"> | |
| <div class="chart-container"> | |
| <canvas id="barangayChart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="col-md-6 mb-4"> | |
| <div class="card h-100"> | |
| <div class="card-header"> | |
| <div class="d-flex justify-content-between align-items-center"> | |
| <h5 class="mb-0">Educational Background</h5> | |
| <div class="dropdown"> | |
| <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="educationDropdown" data-bs-toggle="dropdown"> | |
| <i data-feather="filter"></i> | |
| </button> | |
| <ul class="dropdown-menu" aria-labelledby="educationDropdown"> | |
| <li><a class="dropdown-item" href="#">This Month</a></li> | |
| <li><a class="dropdown-item" href="#">This Year</a></li> | |
| <li><a class="dropdown-item" href="#">All Time</a></li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="card-body"> | |
| <div class="chart-container"> | |
| <canvas id="educationChart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Services Tab --> | |
| <div class="tab-pane fade" id="services" role="tabpanel" aria-labelledby="services-tab"> | |
| <div class="row"> | |
| <div class="col-md-6 mb-4"> | |
| <div class="card h-100"> | |
| <div class="card-header"> | |
| <div class="d-flex justify-content-between align-items-center"> | |
| <h5 class="mb-0">Services Utilization</h5> | |
| <div class="dropdown"> | |
| <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="servicesDropdown" data-bs-toggle="dropdown"> | |
| <i data-feather="filter"></i> | |
| </button> | |
| <ul class="dropdown-menu" aria-labelledby="servicesDropdown"> | |
| <li><a class="dropdown-item" href="#">This Month</a></li> | |
| <li><a class="dropdown-item" href="#">This Year</a></li> | |
| <li><a class="dropdown-item" href="#">All Time</a></li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="card-body"> | |
| <div class="chart-container"> | |
| <canvas id="servicesChart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="col-md-6 mb-4"> | |
| <div class="card h-100"> | |
| <div class="card-header"> | |
| <div class="d-flex justify-content-between align-items-center"> | |
| <h5 class="mb-0">Beneficiary Categories</h5> | |
| <div class="dropdown"> | |
| <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="beneficiaryDropdown" data-bs-toggle="dropdown"> | |
| <i data-feather="filter"></i> | |
| </button> | |
| <ul class="dropdown-menu" aria-labelledby="beneficiaryDropdown"> | |
| <li><a class="dropdown-item" href="#">This Month</a></li> | |
| <li><a class="dropdown-item" href="#">This Year</a></li> | |
| <li><a class="dropdown-item" href="#">All Time</a></li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="card-body"> | |
| <div class="chart-container"> | |
| <canvas id="beneficiaryChart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Jobs Tab --> | |
| <div class="tab-pane fade" id="jobs" role="tabpanel" aria-labelledby="jobs-tab"> | |
| <div class="row"> | |
| <div class="col-md-6 mb-4"> | |
| <div class="card h-100"> | |
| <div class="card-header"> | |
| <div class="d-flex justify-content-between align-items-center"> | |
| <h5 class="mb-0">Job Applications</h5> | |
| <div class="dropdown"> | |
| <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="applicationsDropdown" data-bs-toggle="dropdown"> | |
| <i data-feather="filter"></i> | |
| </button> | |
| <ul class="dropdown-menu" aria-labelledby="applicationsDropdown"> | |
| <li><a class="dropdown-item" href="#">This Month</a></li> | |
| <li><a class="dropdown-item" href="#">This Year</a></li> | |
| <li><a class="dropdown-item" href="#">All Time</a></li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="card-body"> | |
| <div class="chart-container"> | |
| <canvas id="applicationsChart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="col-md-6 mb-4"> | |
| <div class="card h-100"> | |
| <div class="card-header"> | |
| <div class="d-flex justify-content-between align-items-center"> | |
| <h5 class="mb-0">Job Status</h5> | |
| <div class="dropdown"> | |
| <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="jobStatusDropdown" data-bs-toggle="dropdown"> | |
| <i data-feather="filter"></i> | |
| </button> | |
| <ul class="dropdown-menu" aria-labelledby="jobStatusDropdown"> | |
| <li><a class="dropdown-item" href="#">This Month</a></li> | |
| <li><a class="dropdown-item" href="#">This Year</a></li> | |
| <li><a class="dropdown-item" href="#">All Time</a></li> | |
| </ul> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="card-body"> | |
| <div class="chart-container"> | |
| <canvas id="jobStatusChart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| </div> | |
| </div> | |
| <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> | |
| <script> | |
| feather.replace(); | |
| // Initialize all charts with fade-in animation | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Animate sidebar items sequentially | |
| anime({ | |
| targets: '.sidebar-link', | |
| translateX: [-50, 0], | |
| opacity: [0, 1], | |
| delay: anime.stagger(100), | |
| duration: 800, | |
| easing: 'easeOutExpo' | |
| }); | |
| // Animate dashboard header | |
| anime({ | |
| targets: '.h2', | |
| translateY: [-20, 0], | |
| opacity: [0, 1], | |
| duration: 800, | |
| easing: 'easeOutExpo' | |
| }); | |
| // Pulsing effect for active nav-pill | |
| setInterval(() => { | |
| anime({ | |
| targets: '.nav-pills .nav-link.active', | |
| scale: [1, 1.03, 1], | |
| duration: 1500, | |
| easing: 'easeInOutSine' | |
| }); | |
| }, 2000); | |
| }); | |
| // Tab switch animation | |
| document.querySelectorAll('[data-bs-toggle="pill"]').forEach(tab => { | |
| tab.addEventListener('shown.bs.tab', function() { | |
| anime({ | |
| targets: '.tab-pane.active', | |
| opacity: [0, 1], | |
| translateY: [20, 0], | |
| duration: 600, | |
| easing: 'easeOutExpo' | |
| }); | |
| }); | |
| }); | |
| // Enhanced Chart Animations | |
| function animateChart(chart, animationDuration = 1000) { | |
| anime({ | |
| targets: chart.canvas, | |
| opacity: [0, 1], | |
| scale: [0.95, 1], | |
| duration: animationDuration, | |
| easing: 'easeOutExpo' | |
| }); | |
| chart.data.datasets.forEach((dataset, i) => { | |
| anime({ | |
| targets: dataset, | |
| _meta: Object.keys(chart.data.datasets).map(key => ({ | |
| value: [0, chart.data.datasets[i].data[key]] | |
| })), | |
| duration: animationDuration, | |
| easing: 'easeOutExpo' | |
| }); | |
| }); | |
| } | |
| // Sex Chart | |
| const sexCtx = document.getElementById('sexChart').getContext('2d'); | |
| const sexChart = new Chart(sexCtx, { | |
| type: 'pie', | |
| data: { | |
| labels: ['Male', 'Female'], | |
| datasets: [{ | |
| data: [724, 521], | |
| backgroundColor: [ | |
| 'rgba(152, 255, 152, 0.7)', | |
| 'rgba(209, 255, 209, 0.7)' | |
| ], | |
| borderColor: [ | |
| 'rgba(152, 255, 152, 1)', | |
| 'rgba(209, 255, 209, 1)' | |
| ], | |
| borderWidth: 1 | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| maintainAspectRatio: false, | |
| animation: { | |
| duration: 2000, | |
| easing: 'easeOutQuart' | |
| }, | |
| plugins: { | |
| legend: { | |
| position: 'right', | |
| labels: { | |
| font: { | |
| family: "'Segoe UI', Tahoma, Geneva, Verdana, sans-serif", | |
| size: 12 | |
| }, | |
| padding: 20, | |
| usePointStyle: true, | |
| pointStyle: 'circle' | |
| } | |
| } | |
| }, | |
| elements: { | |
| arc: { | |
| borderWidth: 0 | |
| } | |
| } | |
| } | |
| }); | |
| // Call animation after chart creation | |
| animateChart(sexChart); | |
| // Age Chart | |
| const ageCtx = document.getElementById('ageChart').getContext('2d'); | |
| const ageChart = new Chart(ageCtx, { | |
| type: 'bar', | |
| data: { | |
| labels: ['15-17', '18-25', '26-29', '30-35', '36+'], | |
| datasets: [{ | |
| label: 'Number of Clients', | |
| data: [156, 542, 287, 198, 62], | |
| backgroundColor: 'rgba(152, 255, 152, 0.7)', | |
| borderColor: 'rgba(152, 255, 152, 1)', | |
| borderWidth: 1 | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| maintainAspectRatio: false, | |
| scales: { | |
| y: { | |
| beginAtZero: true, | |
| grid: { | |
| color: 'rgba(0,0,0,0.05)' | |
| } | |
| }, | |
| x: { | |
| grid: { | |
| display: false | |
| } | |
| } | |
| }, | |
| plugins: { | |
| legend: { | |
| display: false | |
| } | |
| }, | |
| animation: { | |
| duration: 2000, | |
| easing: 'easeOutQuart' | |
| }, | |
| elements: { | |
| bar: { | |
| borderRadius: 8, | |
| backgroundColor: 'rgba(152, 255, 152, 0.7)', | |
| hoverBackgroundColor: 'rgba(121, 199, 121, 0.8)' | |
| } | |
| } | |
| } | |
| }); | |
| animateChart(ageChart); | |
| // Barangay Chart | |
| const barangayCtx = document.getElementById('barangayChart').getContext('2d'); | |
| const barangayChart = new Chart(barangayCtx, { | |
| type: 'doughnut', | |
| data: { | |
| labels: ['Poblacion', 'Balili', 'Wangal', 'Beckel', 'Betag', 'Others'], | |
| datasets: [{ | |
| data: [320, 210, 180, 150, 120, 265], | |
| backgroundColor: [ | |
| 'rgba(152, 255, 152, 0.7)', | |
| 'rgba(121, 199, 121, 0.7)', | |
| 'rgba(209, 255, 209, 0.7)', | |
| 'rgba(100, 221, 100, 0.7)', | |
| 'rgba(70, 180, 70, 0.7)', | |
| 'rgba(40, 150, 40, 0.7)' | |
| ], | |
| borderColor: [ | |
| 'rgba(152, 255, 152, 1)', | |
| 'rgba(121, 199, 121, 1)', | |
| 'rgba(209, 255, 209, 1)', | |
| 'rgba(100, 221, 100, 1)', | |
| 'rgba(70, 180, 70, 1)', | |
| 'rgba(40, 150, 40, 1)' | |
| ], | |
| borderWidth: 1 | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| maintainAspectRatio: false, | |
| animation: { | |
| duration: 2000, | |
| easing: 'easeOutQuart' | |
| }, | |
| plugins: { | |
| legend: { | |
| position: 'right', | |
| labels: { | |
| font: { | |
| family: "'Segoe UI', Tahoma, Geneva, Verdana, sans-serif", | |
| size: 12 | |
| }, | |
| padding: 20, | |
| usePointStyle: true, | |
| pointStyle: 'circle' | |
| } | |
| } | |
| }, | |
| elements: { | |
| arc: { | |
| borderWidth: 0 | |
| } | |
| }, | |
| cutout: '65%' | |
| } | |
| }); | |
| animateChart(barangayChart); | |
| // Education Chart | |
| const educationCtx = document.getElementById('educationChart').getContext('2d'); | |
| const educationChart = new Chart(educationCtx, { | |
| type: 'pie', | |
| data: { | |
| labels: ['Elementary', 'High School', 'Vocational', 'College', 'Post Graduate'], | |
| datasets: [{ | |
| data: [187, 342, 156, 420, 140], | |
| backgroundColor: [ | |
| 'rgba(152, 255, 152, 0.7)', | |
| 'rgba(121, 199, 121, 0.7)', | |
| 'rgba(209, 255, 209, 0.7)', | |
| 'rgba(100, 221, 100, 0.7)', | |
| 'rgba(70, 180, 70, 0.7)' | |
| ], | |
| borderColor: [ | |
| 'rgba(152, 255, 152, 1)', | |
| 'rgba(121, 199, 121, 1)', | |
| 'rgba(209, 255, 209, 1)', | |
| 'rgba(100, 221, 100, 1)', | |
| 'rgba(70, 180, 70, 1)' | |
| ], | |
| borderWidth: 1 | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| maintainAspectRatio: false, | |
| animation: { | |
| duration: 2000, | |
| easing: 'easeOutQuart' | |
| }, | |
| plugins: { | |
| legend: { | |
| position: 'right', | |
| labels: { | |
| font: { | |
| family: "'Segoe UI', Tahoma, Geneva, Verdana, sans-serif", | |
| size: 12 | |
| }, | |
| padding: 20, | |
| usePointStyle: true, | |
| pointStyle: 'circle' | |
| } | |
| } | |
| }, | |
| elements: { | |
| arc: { | |
| borderWidth: 0 | |
| } | |
| } | |
| } | |
| }); | |
| animateChart(educationChart); | |
| // Services Chart | |
| const servicesCtx = document.getElementById('servicesChart').getContext('2d'); | |
| const servicesChart = new Chart(servicesCtx, { | |
| type: 'bar', | |
| data: { | |
| labels: ['SPES', 'TUPAD', 'LEEP', 'Job Start', 'GIP', 'Livelihood', 'Job Seeker'], | |
| datasets: [{ | |
| label: 'Number of Clients', | |
| data: [245, 187, 156, 98, 120, 210, 329], | |
| backgroundColor: 'rgba(152, 255, 152, 0.7)', | |
| borderColor: 'rgba(152, 255, 152, 1)', | |
| borderWidth: 1 | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| maintainAspectRatio: false, | |
| scales: { | |
| y: { | |
| beginAtZero: true, | |
| grid: { | |
| color: 'rgba(0,0,0,0.05)' | |
| } | |
| }, | |
| x: { | |
| grid: { | |
| display: false | |
| } | |
| } | |
| }, | |
| plugins: { | |
| legend: { | |
| display: false | |
| } | |
| }, | |
| animation: { | |
| duration: 2000, | |
| easing: 'easeOutQuart' | |
| }, | |
| elements: { | |
| bar: { | |
| borderRadius: 8, | |
| backgroundColor: ctx => { | |
| const colors = [ | |
| 'rgba(152, 255, 152, 0.7)', | |
| 'rgba(121, 199, 121, 0.7)', | |
| 'rgba(209, 255, 209, 0.7)', | |
| 'rgba(100, 221, 100, 0.7)', | |
| 'rgba(70, 180, 70, 0.7)', | |
| 'rgba(40, 150, 40, 0.7)', | |
| 'rgba(20, 120, 20, 0.7)' | |
| ]; | |
| return colors[ctx.dataIndex % colors.length]; | |
| }, | |
| hoverBackgroundColor: ctx => { | |
| const colors = [ | |
| 'rgba(152, 255, 152, 0.9)', | |
| 'rgba(121, 199, 121, 0.9)', | |
| 'rgba(209, 255, 209, 0.9)', | |
| 'rgba(100, 221, 100, 0.9)', | |
| 'rgba(70, 180, 70, 0.9)', | |
| 'rgba(40, 150, 40, 0.9)', | |
| 'rgba(20, 120, 20, 0.9)' | |
| ]; | |
| return colors[ctx.dataIndex % colors.length]; | |
| } | |
| } | |
| } | |
| } | |
| }); | |
| animateChart(servicesChart); | |
| // Beneficiary Chart | |
| const beneficiaryCtx = document.getElementById('beneficiaryChart').getContext('2d'); | |
| const beneficiaryChart = new Chart(beneficiaryCtx, { | |
| type: 'pie', | |
| data: { | |
| labels: ['Employed', 'Self-Employed', 'Unemployed'], | |
| datasets: [{ | |
| data: [420, 312, 513], | |
| backgroundColor: [ | |
| 'rgba(152, 255, 152, 0.7)', | |
| 'rgba(121, 199, 121, 0.7)', | |
| 'rgba(209, 255, 209, 0.7)' | |
| ], | |
| borderColor: [ | |
| 'rgba(152, 255, 152, 1)', | |
| 'rgba(121, 199, 121, 1)', | |
| 'rgba(209, 255, 209, 1)' | |
| ], | |
| borderWidth: 1 | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| maintainAspectRatio: false, | |
| animation: { | |
| duration: 2000, | |
| easing: 'easeOutQuart' | |
| }, | |
| plugins: { | |
| legend: { | |
| position: 'right', | |
| labels: { | |
| font: { | |
| family: "'Segoe UI', Tahoma, Geneva, Verdana, sans-serif", | |
| size: 12 | |
| }, | |
| padding: 20, | |
| usePointStyle: true, | |
| pointStyle: 'circle' | |
| } | |
| } | |
| }, | |
| elements: { | |
| arc: { | |
| borderWidth: 0 | |
| } | |
| }, | |
| cutout: '60%' | |
| } | |
| }); | |
| animateChart(beneficiaryChart); | |
| // Applications Chart | |
| const applicationsCtx = document.getElementById('applicationsChart').getContext('2d'); | |
| const applicationsChart = new Chart(applicationsCtx, { | |
| type: 'line', | |
| data: { | |
| labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], | |
| datasets: [{ | |
| label: 'Job Applications', | |
| data: [45, 62, 78, 95, 120, 85, 92, 110, 76, 103, 88, 65], | |
| backgroundColor: 'rgba(152, 255, 152, 0.2)', | |
| borderColor: 'rgba(152, 255, 152, 1)', | |
| borderWidth: 2, | |
| tension: 0.1, | |
| fill: true | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| maintainAspectRatio: false, | |
| scales: { | |
| y: { | |
| beginAtZero: true, | |
| grid: { | |
| color: 'rgba(0,0,0,0.05)' | |
| } | |
| }, | |
| x: { | |
| grid: { | |
| display: false | |
| } | |
| } | |
| }, | |
| plugins: { | |
| legend: { | |
| display: false | |
| } | |
| }, | |
| animation: { | |
| duration: 2000, | |
| easing: 'easeOutQuart' | |
| }, | |
| elements: { | |
| point: { | |
| radius: 5, | |
| hoverRadius: 7, | |
| backgroundColor: 'white', | |
| borderWidth: 2, | |
| borderColor: 'rgba(152, 255, 152, 1)' | |
| }, | |
| line: { | |
| tension: 0.3, | |
| borderWidth: 3 | |
| } | |
| } | |
| } | |
| }); | |
| animateChart(applicationsChart); | |
| // Job Status Chart | |
| const jobStatusCtx = document.getElementById('jobStatusChart').getContext('2d'); | |
| const jobStatusChart = new Chart(jobStatusCtx, { | |
| type: 'doughnut', | |
| data: { | |
| labels: ['Active', 'Closed', 'Few Slots Left', 'Expired'], | |
| datasets: [{ | |
| data: [23, 15, 8, 12], | |
| backgroundColor: [ | |
| 'rgba(152, 255, 152, 0.7)', | |
| 'rgba(121, 199, 121, 0.7)', | |
| 'rgba(209, 255, 209, 0.7)', | |
| 'rgba(100, 221, 100, 0.7)' | |
| ], | |
| borderColor: [ | |
| 'rgba(152, 255, 152, 1)', | |
| 'rgba(121, 199, 121, 1)', | |
| 'rgba(209, 255, 209, 1)', | |
| 'rgba(100, 221, 100, 1)' | |
| ], | |
| borderWidth: 1 | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| maintainAspectRatio: false, | |
| animation: { | |
| duration: 2000, | |
| easing: 'easeOutQuart' | |
| }, | |
| plugins: { | |
| legend: { | |
| position: 'right', | |
| labels: { | |
| font: { | |
| family: "'Segoe UI', Tahoma, Geneva, Verdana, sans-serif", | |
| size: 12 | |
| }, | |
| padding: 20, | |
| usePointStyle: true, | |
| pointStyle: 'circle' | |
| } | |
| } | |
| }, | |
| elements: { | |
| arc: { | |
| borderWidth: 0 | |
| } | |
| }, | |
| cutout: '65%' | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> | |