在练习用charts库对爬取的数据进行数据分析并图表化时遇到一个问题,无法显示图表,如下: 经过重装charts库等一顿折腾后,终于发现一个问题,看这里: def data_gen(type): length = 0 if length <= len(area_index): for area,time in zip(area_index,post_time): if area == '': area = '不明' else: pass data = [{'name':area,'data':[
主题 除了默认的白色底色和dark之外,还支持安装扩展包 pip install echarts-themes-pypkg echarts-themes-pypkg 提供了 vintage, macarons, infographic, shine 和 roma 主题 import random from pyecharts import Bar bar = Bar("我的第一个图表", "这里是vintage") bar.use_theme('vintage')