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.
13 lines
570 B
13 lines
570 B
from pyecharts.charts import Bar
|
|
from pyecharts import options as opts
|
|
# 内置主题类型可查看 pyecharts.globals.ThemeType
|
|
from pyecharts.globals import ThemeType
|
|
|
|
# 不习惯链式调用的开发者依旧可以单独调用方法
|
|
bar = Bar(init_opts=opts.InitOpts(theme=ThemeType.LIGHT))
|
|
bar.add_xaxis(["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"])
|
|
bar.add_yaxis("商家A", [5, 20, 36, 10, 75, 90])
|
|
bar.set_global_opts(title_opts=opts.TitleOpts(title="主标题", subtitle="副标题"))
|
|
print(bar.dump_options())
|
|
# bar.render()
|