基本信息
公司名称
|
上海沪工机械股份有限公司
|
股票代码
|
SH600415
|
行业
|
机械制造
|
总部地址
|
上海市奉贤区
|
财务数据
营收 (近四季度)
|
净利润 (近四季度)
|
资产负债率
|
每股收益 (TTM)
|
script.js
javascript
// Fetch real-time stock data
fetch('https://api.example.com/stock-data').then(response => response.json()).then(data => {// Populate the table with the real-time stock dataconst tableBody = document.querySelector('tbody');data.forEach(stock => {const row = `${stock.date}${stock.open}${stock.high}${stock.low}
${stock.close}`;tableBody.insertAdjacentHTML('beforeend', row);});// Create a chart using the dataconst chartContainer = document.getElementById('chartContainer');const chart = new CanvasJS.Chart(chartContainer, {title: {text: '上海沪工股票历史走势图'},data: [{type: 'line',dataPoints: data.map(stock => ({x: new Date(stock.date),y: stock.close}))}]});chart.render();});