今天测试了pyecharts中的16个主题样式,记录一下,以后备用
1、用的代码
c = (
Bar(init_opts=opts.InitOpts(theme=ThemeType.PURPLE_PASSION))
.add_xaxis([1, 2, 3, 4, 5])
.add_yaxis("product1", list2, stack="stack1", category_gap="50%")
.add_yaxis("product2", list3, stack="stack1", category_gap="50%")
.set_series_opts(
label_opts=opts.LabelOpts(
position="right",
formatter=JsCode(
"function(x){return Number(x.data.percent * 100).toFixed() + '%';}"
),
)
)
.render("stack_bar_percent.html")
)