from pyecharts import options as opts
from pyecharts.charts import Bar, Line, Pie, Radar, Grid
1.插入柱形图数据
x_data = ['2014', '2015', '2016', '2017', '2018', '2019', '2020', '2021']
bar = (
Bar()
2.配置x轴与y轴
.add_xaxis(x_data)
.add_yaxis(
"诊疗量",
[87430, 90912, 96225, 101885, 107147, 116390, 105764, 120215],
yaxis_index=0,#设置y轴索引,为第一条y轴
z=0,#将z轴的值调整为0,使得z值更大的折线图能覆盖在柱形图上
color="orange",
label_opts=opts.LabelOpts(is_show=False)
)
3. 拓展并配置第二条y轴并且设置刻度样式
.extend_axis(
yaxis=opts.AxisOpts(
type_="value",
name="同比增速(%)",