我在Jupyter Notebook中使用pyecharts库做可视化图表时,发现无法显示!
通过上网查询,方法都基本相似,但其中会遇到一些问题,我详细讲一下我解决这个问题的过程:
首先,我按照网络上的步骤,进行资源引用(可参考此链接:资源引用)。
# 1、获取 pyecharts-assets 项目
git clone https://github.com/pyecharts/pyecharts-assets.git
# 2、安装扩展插件
cd pyecharts-assets
# 安装并激活插件
jupyter nbextension install assets
jupyter nbextension enable assets/main
# 3、配置 pyecharts 全局 HOST
# 只需要在顶部声明 CurrentConfig.ONLINE_HOST 即可
from pyecharts.globals import CurrentConfig, Onlin