import datetime import time # pip install pyecharts -U # 黄海定义的输出信息的办法,带当前时间 def logInfo(msg): i = datetime.datetime.now() print(" %s %s" % (i, msg)) from pyecharts.charts import Bar from pyecharts import options as opts # 不习惯链式调用的开发者依旧可以单独调用方法 bar = Bar() bar.add_xaxis(["衬衫", "毛衣", "领带", "裤子", "风衣", "高跟鞋", "袜子"]) bar.add_yaxis("商家A", [114, 55, 27, 101, 125, 27, 105]) bar.add_yaxis("商家B", [57, 134, 137, 129, 145, 60, 49]) bar.set_global_opts(title_opts=opts.TitleOpts(title="某商场销售情况")) print(bar.dump_options()) bar.render()