调整pyechart的画布大小
调整pyechart的画布大小from pyecharts.charts import Barfrom pyecharts import options as opts# 内置主题类型可查看 pyecharts.globals.ThemeTypefrom pyecharts.globals import ThemeTypebar = (Bar(init_opts=opts.InitOpts(wid
·
调整pyechart的画布大小
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(width="1700px",
height="750px",
page_title="造价四剑客",
theme=ThemeType.DARK))
.add_xaxis(["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"])
.add_yaxis("商家A", [5, 20, 36, 10, 75, 90])
.add_yaxis("商家B", [15, 6, 45, 20, 35, 66])
.set_global_opts(title_opts=opts.TitleOpts(title="商家销售汇总",subtitle="分类汇总"))
#.set_global_opts(title_opts=opts.TitleOpts(title="主标题", subtitle="副标题"))
)
bar.render("123.html")
结果如下。
更多推荐
已为社区贡献2条内容
所有评论(0)