import json f_us=open("F:/美国.txt","r",encoding="UTF-8") f_jp=open("F:/日本.txt","r",encoding="UTF-8") f_in=open("F:/印度.txt","r",encoding="UTF-8") us_data=f_us.read() jp_data=f_jp.read() in_data=f_in.read() us_data=us_data.replace("jsonp_1629344292311_69436(","") jp_data=jp_data.replace("jsonp_1629350871167_29498(","") in_data=in_data.replace("jsonp_1629350745930_63180(","") us_data=us_data[:-2] in_data=in_data[:-2] jp_data=jp_data[:-2] us_data=json.loads(us_data) in_data=json.loads(in_data) jp_data=json.loads(jp_data) x=us_data['data'][0]['trend']['updateDate'][:314] us_data=us_data['data'][0]['trend']['list'][0]['data'][:314] in_data=in_data['data'][0]['trend']['list'][0]['data'][:314] jp_data=jp_data['data'][0]['trend']['list'][0]['data'][:314] f_us.close() f_in.close() f_jp.close() from pyecharts.charts import Line from pyecharts.options import TitleOpts,LabelOpts line=Line() line.add_xaxis(x) line.add_yaxis("美国感染",us_data,label_opts=LabelOpts(is_show=False)) line.add_yaxis("印度感染",in_data,label_opts=LabelOpts(is_show=False)) line.add_yaxis("日本感染",jp_data,label_opts=LabelOpts(is_show=False)) line.render()
标签:23,trend,美日韩,jp,us,json,2022,line,data From: https://www.cnblogs.com/yhkdw/p/17274686.html