导致这些情况的原因是pyechart的 v0.5.X 和 V1.0.X 间完全不兼容,V1.0.X 是一个全新的版本,
而网上大部分是 v0.5.X的教程
Github:https://github.com/pyecharts/pyecharts/
from pyecharts.charts import Bar
from pyecharts import options as opts
bar = (
Bar()
.add_xaxis(["衬衫", "毛衣", "领带", "裤子", "风衣", "高跟鞋", "袜子"])
.add_yaxis("商家A", [114, 55, 27, 101, 125, 27, 105])
.add_yaxis("商家B", [57, 134, 137, 129, 145, 60, 49])
.set_global_opts(title_opts=opts.TitleOpts(title="某商场销售情况"))
)
bar.render()