離線使用
v1.0之后,pyecharts默認使用在線的js asset文件,如果沒聯網會導致生成html打開后是空白。離線使用需要指定為本地的assets路徑。
-
下載assets https://github.com/pyecharts/pyecharts-assets 解壓縮。
-
在腳本里指定asset為上述目錄
from pyecharts.globals import CurrentConfig, OnlineHostType CurrentConfig.ONLINE_HOST = "/xx/pyecharts-assets-master/assets/"
Warning消除
version 1.8.0 更新之后控制台會出現 PendingDeprecationWarning 的提示,如需關閉,請在腳本加入如下代碼:
from pyecharts.globals import WarningType WarningType.ShowWarning = False