开始在生死边缘疯狂试探
数据要求还是比较严格,经常会绘制图片失败或是出错,暂时不知道什么原因
from pyecharts.render import make_snapshot
from snapshot_selenium import snapshot
def themeriverDraw(wordData, dataInfo):
c = (
ThemeRiver(init_opts=opts.InitOpts(bg_color="white"))
.add(
wordData,
dataInfo,
singleaxis_opts=opts.SingleAxisOpts(type_="time", pos_bottom="10%"),
)
.set_global_opts(
title_opts=opts.TitleOpts(title=title),
legend_opts=opts.LegendOpts(pos_left="20%")
)
)
return c
make_snapshot(snapshot, themeriverDraw(word_data, data_info).render(), outFile)