You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
707 B
24 lines
707 B
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()
|