Files
agent-demo/public/charts/weather-1792835428128.html
T
2026-10-24 18:23:25 +08:00

1 line
1.2 KiB
HTML

<!DOCTYPE html><html><head><meta charset="utf-8"><title>深圳 未来3天温度变化</title><script src="https://cdn.jsdelivr.net/npm/echarts@5.5.0/dist/echarts.min.js"></script><style>body{margin:0;background:#0f172a;color:#e2e8f0;font-family:system-ui}#c{width:100vw;height:100vh}</style></head><body><div id="c"></div><script>const days=[{"date":"2026-10-24","max":32,"min":22,"desc":"阴"},{"date":"2026-10-25","max":32,"min":22,"desc":"阴"},{"date":"2026-10-26","max":30,"min":23,"desc":"毛毛雨"}];const ch=echarts.init(document.getElementById('c'));ch.setOption({title:{text:'深圳 未来3天温度变化',left:'center',textStyle:{color:'#e2e8f0'}},tooltip:{trigger:'axis'},legend:{data:['最高温','最低温'],textStyle:{color:'#e2e8f0'}},grid:{left:55,right:40,top:80,bottom:55},xAxis:{type:'category',data:days.map(r=>r.date),axisLabel:{color:'#94a3b8'}},yAxis:{type:'value',name:'°C',axisLabel:{color:'#94a3b8'}},series:[{name:'最高温',type:'line',smooth:true,data:days.map(r=>r.max),lineStyle:{width:3,color:'#fb7185'},itemStyle:{color:'#fb7185'}},{name:'最低温',type:'line',smooth:true,data:days.map(r=>r.min),lineStyle:{width:3,color:'#38bdf8'},itemStyle:{color:'#38bdf8'}}]});addEventListener('resize',()=>ch.resize());</script></body></html>