pip install snapshot-selenium
from pyecharts.render import make_snapshot from snapshot_selenium import snapshot #proname_list 是 lable, pie_chart_knums_data 是 value pie_knums_info = ( Pie().add( "", [list(z) for z in zip(proname_list, pie_chart_knums_data)], label_opts=opts.LabelOpts(is_show=False), ) .set_global_opts( title_opts=opts.TitleOpts(title="今年各项目 框数情况"), legend_opts=opts.LegendOpts(orient="vertical", pos_top="15%", pos_left="2%"), ) .set_dark_mode() .set_series_opts(label_opts=opts.LabelOpts(formatter="{b}: {c}")) ) make_snapshot(snapshot,pie_knums_info.render(),save_path+"pie_knums_info.png")
标签:set,pyecharts,pie,图表,snapshot,本地,knums,opts From: https://www.cnblogs.com/taotao0805/p/17053638.html