自己在使用的时候遇到的问题,也是看了很多博客
实际上,官网就有使用方法
附链接https://pyecharts.org/#/zh-cn/render_images
我使用的是snapshot-phantomjs
snapshot-phantomjs 是 pyecharts + phantomjs 渲染图片的扩展,需要先安装 phantomjs,安装方法请参照官网 phantomjs.org/download.html
安装完成后,注意添加环境变量
另一方面,似乎并不需要安装Nodejs
博主是装了Nodejs之后才发现官网就有方法,所以不确定到底要不要
如果需要安装,可以参照此篇
https://www.jianshu.com/p/03a76b2e7e00
测试例子
```python
!pip install snapshot-phantomjs #若第一次运行请保留,否则注释即可
from pyecharts import options as opts
from pyecharts.charts import Bar
from pyecharts.render import make_snapshot
from snapshot_phantomjs import snapshot
def bar_chart() -> Bar:
c = (
Bar()
.add_xaxis(["衬衫", "毛衣", "领带", "裤子", "风衣", "高跟鞋", "袜子"])
.add_yaxis("商家A", [114, 55, 27, 101, 125,