pycharm——漏斗图

复制代码
import pyecharts.options as opts
from pyecharts.charts import Funnel

"""
Gallery 使用 pyecharts 1.1.0
参考地址: https://echarts.apache.org/examples/editor.html?c=funnel

目前无法实现的功能:

1、暂时无法对漏斗图的长宽等范围操作进行修改
"""
x_data =  [
            "高等数学1,2",
            "C语言程序设计",
            "python程序设计",
            "大数据导论",
            "数据结构",
            "大数据与人工智能",
        ]
y_data = [100, 80, 60, 40, 20,30]

data = [[x_data[i], y_data[i]] for i in range(len(x_data))]

(
    Funnel()
    .add(
        series_name="",
        data_pair=data,
        gap=2,
        tooltip_opts=opts.TooltipOpts(trigger="item", formatter="{a} <br/>{b} : {c}%"),
        label_opts=opts.LabelOpts(is_show=True, position="inside"),
        itemstyle_opts=opts.ItemStyleOpts(border_color="#fff", border_width=1),
    )
    .set_global_opts(title_opts=opts.TitleOpts(title="学习比例"))
    .render("funnel_chart.html")
)
相关推荐
飞猪~3 小时前
LangChain python 版本 第一集
开发语言·python·langchain
2601_956319884 小时前
最新AI量化提效,先做可验证的小流程
人工智能·python
开飞机的舒克_5 小时前
FastAPI 实战入门:从路由、参数校验到依赖注入的后端开发指南
python·fastapi
2601_961593425 小时前
Mac 上搭建Linux环境吗?VMware + CentOS Stream 9 镜像快速部署
linux·运维·ide·macos·centos
霸道流氓气质5 小时前
Kiro 中反编译 JAR 包并分析字节码的流程指南
chrome·python·jar
人工智能时代 准备好了吗6 小时前
AI回答内容进入率监测:引用识别、文本匹配与语义判断
开发语言·人工智能·python
Metaphor6927 小时前
使用 Python 冻结 Excel 文件中的行、列和单元格
开发语言·python·excel
言乐67 小时前
Python实现建造微服务商城后台
开发语言·python·算法·微服务·架构
fenglllle7 小时前
chromadb emmbedding 向量检索
人工智能·python·embedding
cui_ruicheng7 小时前
Python从入门到实战(六):非序列容器
开发语言·python