Non-Profit Performance Dashboard

Non-Profit Performance Dashboard

Monitor fundraising, donor engagement, and volunteer impact.

Total Donations

$0

Total Donors

0

Average Donation

$0

Volunteer Hours

0

Donations Over Time

Donations by Campaign

New vs. Returning Donors

Volunteer Hours by Program

Performance Narrative

Engagement efforts successfully attracted ${newDonors} new donors. On the volunteering front, the community contributed a total of ${totalHours} hours of their time, showing strong support for our programs.

`; narrativeContentEl.innerHTML = narrative; }; // --- FORM LOGIC --- activityTypeSelect.addEventListener('change', (e) => { const type = e.target.value; document.getElementById('donation-fields').style.display = type === 'donation' ? 'grid' : 'none'; document.getElementById('volunteer-fields').style.display = type === 'volunteer' ? 'grid' : 'none'; }); // --- EVENT HANDLERS --- if (dataForm) { dataForm.addEventListener('submit', function (e) { e.preventDefault(); const type = activityTypeSelect.value; if (!type) { alert('Please select an activity type.'); return; } const newEntry = { id: Date.now(), type, date: dataForm.date.value }; if (type === 'donation') { Object.assign(newEntry, { amount: parseFloat(dataForm.amount.value), donorType: dataForm.donorType.value, campaign: dataForm.campaign.value, donorId: dataForm.donorType.value === 'New' ? `D${Date.now()}` : `D00${Math.floor(Math.random() * 5) + 1}` // simplified logic for sample }); } else { Object.assign(newEntry, { hours: parseInt(dataForm.hours.value), program: dataForm.program.value }); } activityData.push(newEntry); dataForm.reset(); document.getElementById('donation-fields').style.display = 'none'; document.getElementById('volunteer-fields').style.display = 'none'; showTab('dashboard'); renderAll(); }); } window.deleteData = (id) => { activityData = activityData.filter(item => item.id !== id); renderAll(); }; if (pdfDownloadBtn) { pdfDownloadBtn.addEventListener('click', function () { const { jsPDF } = window.jspdf; const doc = new jsPDF({ orientation: 'landscape', unit: 'pt', format: 'a4' }); const contentToPrint = document.getElementById('dashboard-content'); if (!contentToPrint) return; html2canvas(contentToPrint, { scale: 2, useCORS: true, onclone: (doc) => { Chart.defaults.animation = false; } }) .then(canvas => { Chart.defaults.animation = true; const imgData = canvas.toDataURL('image/png'); const imgProps = doc.getImageProperties(imgData); const pdfWidth = doc.internal.pageSize.getWidth() - 40; const pdfHeight = (imgProps.height * pdfWidth) / imgProps.width; doc.text(`Non-Profit Performance Report - ${new Date().toLocaleDateString()}`, 20, 20); doc.addImage(imgData, 'PNG', 20, 40, pdfWidth, pdfHeight); doc.save(`non-profit-performance-report.pdf`); }).catch(err => { Chart.defaults.animation = true; console.error("PDF generation error:", err); }); }); } // --- INITIALIZATION --- renderAll(); showTab('dashboard'); });
Scroll to Top