from pyecharts.charts import Bar from pyecharts import options as opts # 创建一个柱形图实例 bar = Bar() # 设置x轴数据 bar.add_xaxis(["A", "B", "C", "D", "E"]) # 设置y轴数据 bar.add_yaxis("柱形图", [10, 20, 30, 40, 50]) # 设置标题 bar.set_global_opts(title_opts=opts.TitleOpts(title="柱形图示例")) # 渲染图表 bar.render("柱形图.html")
from pyecharts.charts import Bar
from pyecharts import options as opts
# 创建一个柱形图实例
bar = Bar()
# 设置x轴数据
bar.add_xaxis(["A", "B", "C", "D", "E"])
# 设置y轴数据
bar.add_yaxis("柱形图", [10, 20, 30, 40, 50])
# 设置标题
bar.set_global_opts(title_opts=opts.TitleOpts(title="柱形图示例"))
# 渲染图表
bar.render("柱形图.html")