Customer Education Dashboard

Customer Education Dashboard

Key Education Performance Indicators

Education Insights

No insights generated yet. Please configure your data.

Customer Education Dashboard Report

Key Education Performance Indicators

Education Insights

Overall Education Performance: The average progress across all defined metrics is ${avgProgress}%.

`; if (metricsAboveTarget.length > 0) { const directAbove = metricsAboveTarget.filter(m => m.type === 'direct').map(m => `${m.name} (${m.progress}%)`).join(', '); const reductionAbove = metricsAboveTarget.filter(m => m.type === 'reduction').map(m => `${m.name} (Achieved: ${formatValue(educationMetrics.find(em => em.name === m.name).actual, educationMetrics.find(em => em.name === m.name).unit)}, Target: ${formatValue(educationMetrics.find(em => em.name === m.name).target, educationMetrics.find(em => em.name === m.name).unit)})`).join(', '); if (directAbove) { insightsForPdf += `

Strengths: Excellent performance observed in: ${directAbove}. Continue to build on these successful areas.

`; } if (reductionAbove) { insightsForPdf += `

Positive Impact: Metrics showing strong positive impact (e.g., successful ticket reduction) include: ${reductionAbove}. This indicates effective education efforts.

`; } } if (metricsBelowTarget.length > 0) { const directBelow = metricsBelowTarget.filter(m => m.type === 'direct').map(m => `${m.name} (${m.progress}%)`).join(', '); const reductionBelow = metricsBelowTarget.filter(m => m.type === 'reduction').map(m => `${m.name} (Achieved: ${formatValue(educationMetrics.find(em => em.name === m.name).actual, educationMetrics.find(em => em.name === m.name).unit)}, Target: ${formatValue(educationMetrics.find(em => em.name === m.name).target, educationMetrics.find(em => em.name === m.name).unit)})`).join(', '); if (directBelow) { insightsForPdf += `

Areas for Improvement: Metrics currently below target include: ${directBelow}. Focus efforts on these to improve educational outcomes.

`; } if (reductionBelow) { insightsForPdf += `

Areas for Optimization: Metrics requiring further optimization (e.g., ticket reduction not meeting target) include: ${reductionBelow}. Review and refine education content or delivery for these areas.

`; } } insightsForPdf += `
`; } pdfEducationInsights.innerHTML = `

Education Insights

${insightsForPdf}`; // Show the hidden content temporarily for html2canvas to render it pdfContent.style.display = 'block'; showMessage('Generating PDF...', 'info'); try { const canvas = await html2canvas(pdfContent, { scale: 2, // Increase scale for better quality useCORS: true, // If you have external images, enable CORS logging: false // Disable console logging from html2canvas }); const imgData = canvas.toDataURL('image/png'); const { jsPDF } = window.jspdf; const pdf = new jsPDF('p', 'mm', 'a4'); // 'p' for portrait, 'mm' for millimeters, 'a4' size const imgWidth = 210; // A4 width in mm const pageHeight = 297; // A4 height in mm const imgHeight = canvas.height * imgWidth / canvas.width; let heightLeft = imgHeight; let position = 0; pdf.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight); heightLeft -= pageHeight; while (heightLeft >= 0) { position = heightLeft - imgHeight; pdf.addPage(); pdf.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight); heightLeft -= pageHeight; } pdf.save('Customer_Education_Dashboard.pdf'); showMessage('PDF downloaded successfully!', 'success'); } catch (error) { console.error("Error generating PDF:", error); showMessage('Error generating PDF. Please try again.', 'error'); } finally { // Hide the content again after PDF generation pdfContent.style.display = 'none'; } }; } // --- Initial Load --- switchTab('dashboard'); // Start on the dashboard tab renderAllMetricInputRows(); // Render initial data in config tab renderAllKpiCards(); // Render initial data in dashboard tab generateEducationInsights(); // Generate initial insights });
Scroll to Top