Inflation Rate Estimator

Inflation Rate Estimator

Calculate your personal inflation rate based on a custom basket of goods.

Inflation Analysis

Inflation Rate by Category

Settings & Basket of Goods

Category Item Name Start Price ($) End Price ($) Actions

${state.settings.analysisName}: Comparing ${state.settings.startPeriod} to ${state.settings.endPeriod}

Summary of Findings

Overall Inflation Rate
${kpis.overallInflation.toFixed(2)}%
Total Cost Change
$${kpis.costChange.toFixed(2)}
Highest Inflation Category
${kpis.biggestMover.category}

Category Inflation Breakdown

`; const pdfTemplate = document.getElementById('pdf-template'); pdfTemplate.innerHTML = reportHtml; pdfTemplate.classList.remove('invisible'); try { const { jsPDF } = window.jspdf; const canvas = await html2canvas(pdfTemplate.querySelector('.pdf-report-container'), { scale: 2 }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'p', unit: 'pt', format: 'a4' }); pdf.addImage(imgData, 'PNG', 0, 0, pdf.internal.pageSize.getWidth(), (canvas.height * pdf.internal.pageSize.getWidth()) / canvas.width); pdf.save(`${state.settings.analysisName.replace(/\s+/g, '_')}_Inflation_Report.pdf`); } catch(e) { console.error('PDF Generation Error:', e); } finally { downloadPdfBtn.disabled = false; downloadPdfBtn.textContent = 'Download Inflation Report'; pdfTemplate.classList.add('invisible'); } } downloadPdfBtn.addEventListener('click', generatePdfReport); // --- INITIALIZATION --- populateSettingsUI(); renderDataTable(); attachDataListeners(); runAnalysis(); switchTab(0); });
Scroll to Top