GDP Growth & Stock Market Trend Prediction

GDP Growth & Stock Market Trend Prediction

Analysis for 2025 Based on Consensus Forecasts

Global & Regional GDP Forecast

Select a region to view the economic forecast for 2025. Data is aggregated from leading financial institutions.

${data.gdp}

Forecasted Inflation

${data.inflation}

Key Considerations

${data.notes}

`; } } /** * Displays the stock market forecast based on the selected market. */ function displayMarketForecast() { if (!marketSelect || !marketOutput) return; const selectedMarket = marketSelect.value; const data = predictionData.market[selectedMarket]; if (data) { marketOutput.innerHTML = `

${data.title}

2025 Return Forecast

${data.forecast}

Key Drivers

${data.drivers}

Potential Risks

${data.risks}

`; } } /** * Generates the final summary report for display and PDF export. */ function generateSummary() { const summaryGdp = document.getElementById('summary-gdp'); const summaryMarket = document.getElementById('summary-market'); const summaryRelationship = document.getElementById('summary-relationship'); if (!summaryGdp || !summaryMarket || !summaryRelationship) return; const gdpData = predictionData.gdp[regionSelect.value]; const marketData = predictionData.market[marketSelect.value]; const relationshipData = predictionData.relationship; summaryGdp.innerHTML = `

${gdpData.title}

  • GDP Growth Forecast: ${gdpData.gdp}
  • Inflation Forecast: ${gdpData.inflation}
  • Outlook: ${gdpData.notes}
`; summaryMarket.innerHTML = `

${marketData.title}

  • Return Forecast: ${marketData.forecast}
  • Key Drivers: ${marketData.drivers}
  • Potential Risks: ${marketData.risks}
`; summaryRelationship.innerHTML = `

${relationshipData.title}

${relationshipData.summary}

`; } /** * Handles PDF download functionality. */ window.downloadPDF = async function() { // Check if libraries are loaded if (typeof window.jspdf === 'undefined' || typeof window.html2canvas === 'undefined') { alert('PDF generation library not loaded. Please try again later.'); console.error("jspdf or html2canvas not found."); return; } const { jsPDF } = window.jspdf; const pdfContent = document.getElementById('pdf-content'); if (!pdfContent) { console.error("PDF content area not found."); return; } try { const canvas = await html2canvas(pdfContent, { scale: 2, // Improve resolution backgroundColor: '#ffffff' }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'p', 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; const imgWidth = pdfWidth - 20; // with margin const imgHeight = imgWidth / ratio; let position = 10; pdf.addImage(imgData, 'PNG', 10, position, imgWidth, imgHeight); pdf.save('GDP_Stock_Prediction_Report-2025.pdf'); } catch (error) { console.error('Error generating PDF:', error); alert('An error occurred while generating the PDF.'); } }; // --- INITIALIZATION --- regionSelect.addEventListener('change', displayGdpForecast); marketSelect.addEventListener('change', displayMarketForecast); // Initial content display changeTab(1); displayGdpForecast(); displayMarketForecast(); });
Scroll to Top