Python全系列 教程
3567个小节阅读:5931.4k
目录
鸿蒙应用开发
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
漏斗图适用于业务流程比较规范、周期长、环节多的流程分析,通过漏斗各环节业务数据的比较,能够直观地发现和说明问题所在。
class pyecharts.charts.Funnel
xxxxxxxxxx
class Funnel(
# 初始化配置项,参考 `global_options.InitOpts`
init_opts: opts.InitOpts = opts.InitOpts()
)
func pyecharts.charts.Funnel.add
xxxxxxxxxx
def add(
# 系列名称,用于 tooltip 的显示,legend 的图例筛选。
series_name: str,
# 系列数据项,格式为 [(key1, value1), (key2, value2)]
data_pair: Sequence,
# 是否选中图例
is_selected: bool = True,
# 系列 label 颜色
color: Optional[str] = None,
# 数据排序, 可以取 'ascending','descending','none'(表示按 data 顺序)
sort_: str = "descending",
# 数据图形间距
gap: Numeric = 0,
# 标签配置项,参考 `series_options.LabelOpts`
label_opts: Union[opts.LabelOpts, dict] = opts.LabelOpts(),
# 提示框组件配置项,参考 `series_options.TooltipOpts`
tooltip_opts: Union[opts.TooltipOpts, dict, None] = None,
# 图元样式配置项,参考 `series_options.ItemStyleOpts`
itemstyle_opts: Union[opts.ItemStyleOpts, dict, None] = None,
)
【示例】绘制漏斗图
xxxxxxxxxx
from pyecharts import options as opts
from pyecharts.charts import Funnel
from pyecharts.faker import Faker
funnel=Funnel()
funnel.add("商品", [list(z) for z in zip(Faker.choose(), Faker.values())])
funnel.set_global_opts(title_opts=opts.TitleOpts(title="Funnel-基本示例"))
funnel.render_notebook()
【示例】绘制漏斗图
xxxxxxxxxx
from pyecharts import options as opts
from pyecharts.charts import Funnel
from pyecharts.faker import Faker
funnel=Funnel()
funnel.add(
"商品",
[list(z) for z in zip(Faker.choose(),
Faker.values())], sort_="ascending",
label_opts=opts.LabelOpts(position="inside"),
)
funnel.set_global_opts(title_opts=opts.TitleOpts(title="Funnel-基本示例"))
funnel.render_notebook()
实时效果反馈
1. _______适用于业务流程比较规范、周期长、环节多的流程分析,通过漏斗各环节业务数据的比较,能够直观地发现和说明问题所在。。
A 条形图
B 饼图
C 箱型图
D 漏斗图
2. pyecharts模块中绘制漏斗图,下划线处分别需要填写的代码是_____:
xxxxxxxxxx
from pyecharts import options as opts
from pyecharts.charts import Funnel
from pyecharts.faker import Faker
funnel=________
funnel.add(
"商品",
[list(z) for z in zip(Faker.choose(),Faker.values())],
__________, #排序
label_opts=opts.LabelOpts(position="inside"),
)
funnel.set_global_opts(title_opts=opts.TitleOpts(title="Funnel-基本示例"))
funnel.render_notebook()
A Funnel() sort="ascending"
B funnel() sort="ascending"
C Funnel() sort_="ascending"
答案
1=>D 2=>C