当前市场行情
金属
|
现货价
|
涨跌幅
|
铜
|
68,000元/吨
|
+1.2%
|
铝
|
19,500元/吨
|
-0.5%
|
铅
|
15,000元/吨
|
+0.8%
|
锌
|
24,000元/吨
|
-1.0%
|
镍
|
160,000元/吨
|
+2.0%
|
历史行情
新闻动态
-
有色金属市场前景看好
-
上海有色金属交易所发布新规
-
专家分析有色金属价格走势
补充的样式和脚本 (style.css 和 script.js)style.css
css
body {font-family: Arial, Helvetica, sans-serif;
}.container {width: 960px;margin: 0 auto;
}header {background-color: 444;color: fff;padding: 10px;
}h1 {font-size: 24px;margin-bottom: 0;
}main {padding: 10px;
}h2 {font-size: 18px;margin-bottom: 10px;
}table {width: 100%;border-collapse: collapse;
}th, td {border: 1px solid ccc;padding: 5px;
}.chart {width: 100%;height: 400px;
}canvas {width: 100%;height: 100%;
}.news {list-style-type: none;padding: 0;
}li {margin-bottom: 5px;
}a {text-decoration: none;color: 000;
}footer {background-color: 444;color: fff;padding: 10px;text-align: center;
}script.js
javascript
const ctx = document.getElementById('myChart');
const myChart = new Chart(ctx, {type: 'line',data: {labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],datasets: [{
label: '铜价',data: [65000, 66000, 67000, 68000, 69000, 70000, 71000, 72000, 73000, 74000, 75000, 76000],borderColor: 'rgba(255, 99, 132, 1)',backgroundColor: 'rgba(255, 99, 132, 0.2)',}, {label: '铝价',data: [18500, 19000, 19500, 20000, 20500, 21000, 21500, 22000, 22500, 23000, 23500, 24000],borderColor: 'rgba(54, 162, 235, 1)',backgroundColor: 'rgba(54, 162, 235, 0.2)',}]},options: {scales: {yAxes: [{ticks: {beginAtZero: true}}]}}
});