Commit e2f8de06 by BellCodeEditor

auto save

parent 0c50951b
Showing with 10 additions and 9 deletions
from pyecharts.charts import Line from pyecharts.charts import Line
import csv import csv
test = ["第1次","第2次","第3次","第4次","第5次","第6次","第7次","第8次","第9次","第10次"]
student1 = [112, 110, 118, 124, 129, 132, 136, 139, 144, 143] # 聪聪
student2 = [128, 131, 132, 129, 130, 127, 129, 131, 132, 128] # 小杰
student3 = [143, 145, 140, 133, 134, 126, 121, 120, 114, 105] # 皮皮
line=Line() line=Line()
line.add_xaxis(test) data = [["姓名", "语文", "数学", "英语"],
line.add_yaxis('聪聪',student1) ["小贝", 98, 99, 92],
line.add_yaxis('小杰',student2) ["聪聪", 95, 91, 95]]
line.add_yaxis('皮皮',student3)
with open('scores.csv','w',encoding='utf-8',newline='') as csvfile:
writer=csv.writer(csvfile)
writer.writerows(data)
line.add_xaxis(data[1])
line.add_yaxis('聪聪',data[2])
line.add_yaxis('小贝',data[3])
line.set_global_opts(title_opts={'test':'聪聪,小杰,皮皮成绩统计图','subtest':'高254班数学'}) line.set_global_opts(title_opts={'test':'聪聪,小杰,皮皮成绩统计图','subtest':'高254班数学'})
line.render() line.render()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment