当前位置:   article > 正文

pyecharts运行后产生的html文件用浏览器打开空白_pycharmhtml打开空白

pycharmhtml打开空白

引用:https://github.com/pyecharts/pyecharts/issues/503

使用logging日志打印代码错误:

  1. #coding=utf-8
  2. #from __future__ import unicode_literals
  3. import logging
  4. import logging.config
  5. logging.basicConfig(
  6. format='%(name)s:%(lineno)d - %(levelname)s - %(message)s',
  7. level=logging.DEBUG)
  8. from pyecharts import Bar
  9. bar = Bar("我的第一个图表", "这里是副标题")
  10. bar.add("服装", ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"], [5, 20, 36, 10, 75, 90])
  11. bar.render()

运行错误:说明是因为库jupyter_echarts_pypkg未安装导致,这个库包含包含所有图表组件

  1. lml.plugin:328 - DEBUG - declare 'pyecharts_js_extension' plugin manager
  2. lml.loader:54 - DEBUG - scanning for plugins...
  3. lml.utils:51 - ERROR - failed to import jupyter_echarts_pypkg
  4. Traceback (most recent call last):
  5. File "C:\Python36\lib\site-packages\lml\utils.py", line 43, in do_import
  6. plugin_module = import(plugin_module_name)
  7. ModuleNotFoundError: No module named 'jupyter_echarts_pypkg'
  8. lml.loader:81 - DEBUG - jupyter_echarts_pypkg
  9. lml.loader:82 - DEBUG - No module named 'jupyter_echarts_pypkg'
  10. lml.loader:84 - DEBUG - scanning done
  11. Process finished with exit code 0

当然,包含所有图表组件我们也可以去http://echarts.baidu.com/download.html下载echarts.min.js

然后在html文件中添加<script src="echarts.min.js"></script> ,也能解决界面空白问题。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/165134
推荐阅读
相关标签
  

闽ICP备14008679号