Subsidiary Performance Dashboard

Subsidiary Performance Dashboard

Overall Performance Summary

Total Subsidiaries

0

Total Revenue ($)

$0

Total Profit ($)

$0

Average Growth Rate

0%

Revenue by Industry

Profit by Region

Growth Rate Distribution

Detailed Subsidiary List

ID Name Industry Region Revenue ($) Expenses ($) Profit ($) Growth Rate (%)

${averageGrowthRateElem.textContent}

`; pdfContentWrapper.appendChild(summarySection); // Add distribution charts const chartsSection = document.createElement('div'); chartsSection.classList.add('grid', 'grid-cols-2', 'gap-6', 'mb-6'); chartsSection.innerHTML = `

Revenue by Industry

Profit by Region

Growth Rate Distribution

`; pdfContentWrapper.appendChild(chartsSection); // Populate PDF charts (re-use logic but target PDF elements) const totalSubs = subsidiaries.length; const totalRev = subsidiaries.reduce((sum, sub) => sum + sub.revenue, 0); const totalProf = subsidiaries.reduce((sum, sub) => sum + sub.profit, 0); const revenueByIndustry = subsidiaries.reduce((acc, sub) => { acc[sub.industry] = (acc[sub.industry] || 0) + sub.revenue; return acc; }, {}); renderBarChart(chartsSection.querySelector('#pdfRevenueByIndustryChart'), revenueByIndustry, totalRev, 'currency'); const profitByRegion = subsidiaries.reduce((acc, sub) => { acc[sub.region] = (acc[sub.region] || 0) + sub.profit; return acc; }, {}); renderBarChart(chartsSection.querySelector('#pdfProfitByRegionChart'), profitByRegion, totalProf, 'currency'); const growthRateBins = { 'Negative (<0%)': 0, 'Low (0-5%)': 0, 'Medium (5-10%)': 0, 'High (>10%)': 0 }; subsidiaries.forEach(sub => { if (sub.growthRate < 0) { growthRateBins['Negative (<0%)']++; } else if (sub.growthRate >= 0 && sub.growthRate <= 5) { growthRateBins['Low (0-5%)']++; } else if (sub.growthRate > 5 && sub.growthRate <= 10) { growthRateBins['Medium (5-10%)']++; } else { growthRateBins['High (>10%)']++; } }); renderBarChart(chartsSection.querySelector('#pdfGrowthRateDistributionChart'), growthRateBins, totalSubs, 'count'); // Add detailed subsidiary list table const subsidiaryListSection = document.createElement('div'); subsidiaryListSection.innerHTML = `

Detailed Subsidiary List

${dashboardSubsidiaryTableBody.innerHTML}
ID Name Industry Region Revenue ($) Expenses ($) Profit ($) Growth Rate (%)
`; pdfContentWrapper.appendChild(subsidiaryListSection); // Options for html2pdf const options = { margin: 10, filename: 'Subsidiary_Performance_Dashboard.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2, logging: true, dpi: 192, letterRendering: true }, jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }, pagebreak: { mode: ['avoid-all', 'css', 'legacy'] } }; // Generate PDF from the temporary content wrapper html2pdf().from(pdfContentWrapper).set(options).save(); // Clean up the temporary div (optional, as it's not appended to the DOM) pdfContentWrapper.remove(); } /** * Loads initial sample data for the dashboard. * Relevant to USA context. */ function loadSampleData() { subsidiaries = [ { id: 'SUB001', name: 'Tech Solutions Inc.', industry: 'Technology', region: 'West', revenue: 2500000, expenses: 1800000, profit: 700000, growthRate: 15.2 }, { id: 'SUB002', name: 'HealthCare Innovations', industry: 'Healthcare', region: 'South East', revenue: 1800000, expenses: 1500000, profit: 300000, growthRate: 8.1 }, { id: 'SUB003', name: 'Finance Hub LLC', industry: 'Finance', region: 'North East', revenue: 3200000, expenses: 2500000, profit: 700000, growthRate: 10.0 }, { id: 'SUB004', name: 'Retail Dynamics', industry: 'Retail', region: 'Mid West', revenue: 1200000, expenses: 1100000, profit: 100000, growthRate: 3.5 }, { id: 'SUB005', name: 'ManuFacto Pro', industry: 'Manufacturing', region: 'South West', revenue: 2000000, expenses: 1700000, profit: 300000, growthRate: 6.8 }, { id: 'SUB006', name: 'Service Excellence', industry: 'Services', region: 'West', revenue: 900000, expenses: 850000, profit: 50000, growthRate: 2.1 }, { id: 'SUB007', name: 'NextGen Tech', industry: 'Technology', region: 'North East', revenue: 1700000, expenses: 1300000, profit: 400000, growthRate: 12.5 }, { id: 'SUB008', name: 'MediCare Solutions', industry: 'Healthcare', region: 'South East', revenue: 1100000, expenses: 1050000, profit: 50000, growthRate: -1.0 } ]; }
Scroll to Top