from pyecharts import charts subjects = ["浈浈", "聪聪", "小智", "波奇"] scores1 = [92, 95, 82, 88] # 期中成绩 scores2 = [95, 79, 93, 90] # 期末成绩 bar = charts.Bar() bar.add_xaxis(subjects) bar.add_yaxis('期中',scores1,bar_width=40) bar.add_yaxis('期末',scores2,bar_width=40) bar.render('test.html')