from pyecharts import options as opts
from pyecharts.charts import Bar
c = (
Bar()
.add_dataset(
source=[
["score", "amount", "product"],
[89.3, 58212, "Matcha Latte"],
[57.1, 78254, "Milk Tea"],
[74.4, 41032, "Cheese Cocoa"],
[50.1, 12755, "Cheese Brownie"],
[89.7, 20145, "Matcha Cocoa"],
[68.1, 79146, "Tea"],
[19.6, 91852, "Orange Juice"],
[10.6, 101852, "Lemon Juice"],
[32.7, 20112, "Walnut Brownie"],
]
)
.add_yaxis(
series_name="",
yaxis_data=[],
encode={"x": "amount", "y": "product"},
label_opts=opts.LabelOpts(is_show=False),
)
.set_global_opts(
title_opts=opts.TitleOpts(title="Dataset normal bar example"),
xaxis_opts=opts.AxisOpts(name="amount"),
yaxis_opts=opts.AxisOpts(type_="category"),
visualmap_opts=opts.VisualMapOpts(
orient="horizontal",
pos_left="center",
min_=10,
max_=100,
range_text=["High Score", "Low Score"],
dimension=0,
range_color=["#D7DA8B", "#E15457"],
),
)
.render("dataset_bar_1.html")
)
数据可视化 - 柱状图 - 可视化映射数据集
原创wx60e3b8a1137fb ©著作权
©著作权归作者所有:来自51CTO博客作者wx60e3b8a1137fb的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
数据可视化 - 柱状图+线状图
7月", "8月...
数据可视化案例 - 大屏电子看板 -
数据可视化 - 柱状图集
3.7], ["Milk Tea", 83.1, 73...
html cocoa