from pyecharts.charts import Bar
from pyecharts.options import *
bar = Bar()
bar.add_xaxis(['中国', 'USA', '不列颠'])
bar.add_yaxis('GDP', [30, 20, 10],
label_opts=LabelOpts(position="right")) # 设置数值位置
bar.reversal_axis()
bar.set_global_opts(
toolbox_opts=ToolboxOpts(is_show=True),
title_opts=TitleOpts(title="简易柱状图")
)
bar.render('基础柱状图.html')