pyecharts make_snapshot 错误 ReferenceError: Can‘t find variable: echarts

1,564 阅读1分钟

渲染时要生成render.html文件,pyecharts里的模板文件js是assets.pyecharts.org/assets/echa…

因为网络原因,有的时候在生成页面的时候不一定能获取到这个文件,所以时不时的会报错。

解决方法:

把这个文件下载下来放在本地


注意:远程 js host,如不设置默认为 assets.pyecharts.org/assets/

所以最后的目录会拼上‘echarts.min.js’

样例:Grid(init_opts=opts.InitOpts(width="1200px", height="1600px",js_host='./'))