看系列教程可以进我的个人主页
本教程使用pyecharts可视化:
pip install pyecharts
def show(hot_search_data: tuple, save_path='hot-search.html'):
bar = (
Bar()
.add_xaxis(hot_search_data[0])
.add_yaxis('搜索量', hot_search_data[1], category_gap='2%')
.set_global_opts(title_opts=options.TitleOpts(
'热搜数据图',
subtitle='stripe-python编写'
))
.set_series_opts(label_opts=options.LabelOpts(is_show=False))
)
bar.render(save_path)
if __name__ == '__main__':
show(hot_search())
搞定!