Asset Allocation Simulator

Risk Tolerance: ${risk.charAt(0).toUpperCase() + risk.slice(1)}

  • Stocks: $${(amount * stocks).toFixed(2)}
  • Bonds: $${(amount * bonds).toFixed(2)}
  • Cash: $${(amount * cash).toFixed(2)}
`; }; window.downloadAllocationPDF = function () { const output = document.getElementById('allocationOutput'); if (!output.innerHTML.trim()) { alert("Please simulate the allocation before downloading."); return; } html2canvas(output).then(canvas => { const { jsPDF } = window.jspdf; const pdf = new jsPDF(); const imgData = canvas.toDataURL('image/png'); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = (canvas.height * pdfWidth) / canvas.width; pdf.addImage(imgData, 'PNG', 0, 10, pdfWidth, pdfHeight); pdf.save("Asset_Allocation_Result.pdf"); }); }; });
Scroll to Top