Global Market Correlation Analysis Tool

Global Market Correlation Analysis Tool

Understand how different asset classes move in relation to each other to build a more resilient portfolio.

Analysis Setup

Select Markets / Asset Classes (min. 3)

Time Horizon

Error generating AI insights.

`; } }; window.downloadPDF = async () => { const btn = document.getElementById('pdf-button-container').querySelector('button'); btn.disabled = true; btn.textContent = 'Generating...'; const { jsPDF } = window.jspdf; const content = document.getElementById('summary-for-pdf'); try { const canvas = await html2canvas(content, { scale: 2, useCORS: true }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'landscape', unit: 'mm', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = pdf.internal.pageSize.getHeight(); const canvasWidth = canvas.width; const canvasHeight = canvas.height; const ratio = canvasWidth / canvasHeight; // Calculate image dimensions to fit within the page margins let imgWidth = pdfWidth - 20; // 10mm margin on each side let imgHeight = imgWidth / ratio; // If the calculated height is too big, rescale based on height instead if (imgHeight > pdfHeight - 20) { imgHeight = pdfHeight - 20; // Max height with margins imgWidth = imgHeight * ratio; // Recalculate width to maintain aspect ratio } // Center the image on the page const x = (pdfWidth - imgWidth) / 2; const y = 10; pdf.addImage(imgData, 'PNG', x, y, imgWidth, imgHeight); pdf.save(`Market_Correlation_Analysis_${new Date().toISOString().slice(0, 10)}.pdf`); } catch(e) { console.error("PDF Generation Error: ", e); alert("An error occurred while generating the PDF."); } finally { btn.disabled = false; btn.textContent = 'Download Analysis as PDF'; } }; // --- INITIALIZATION --- initMarketSelection(); });
Scroll to Top