首页 > 其他分享 >pyecharts 保存图表至本地

pyecharts 保存图表至本地

时间:2023-01-15 16:12:34浏览次数:43  
标签:set pyecharts pie 图表 snapshot 本地 knums opts



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

相关文章