方案一 旋转标签
使用rotate旋转X轴标签
# rotate 旋转角度
bar.set_global_opts(xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(rotate=-15,interval=0)))
方案二 使用grid设置X轴下方距离图片边缘的距离
grid=Grid(init_opts=opts.InitOpts(width="1600px",height="800px"))
# 设置距离 bar为x轴标签过长的柱状图
grid.add(bar,grid_opts=opts.GridOpts(pos_bottom="20%"))
grid.render("bar.html")