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")
)
相关推荐
Stream_Silver16 分钟前
【Agent学习笔记3:使用Python开发简单MCP服务】
笔记·python
穿过锁扣的风20 分钟前
零基础入门 Python 爬虫:从基础到实战,爬取虎扑 / 豆瓣 / 图片全掌握
开发语言·爬虫·python
Stream_Silver24 分钟前
【Agent学习笔记2:深入理解Function Calling技术:从原理到实践】
笔记·python
love530love43 分钟前
技术复盘:llama-cpp-python CUDA 编译实战 (Windows)
人工智能·windows·python·llama·aitechlab·cpp-python·cuda版本
逄逄不是胖胖2 小时前
《动手学深度学习》-60translate实现
人工智能·python·深度学习
橘颂TA2 小时前
【测试】自动化测试函数介绍——web 测试
python·功能测试·selenium·测试工具·dubbo
爱学习的阿磊2 小时前
Python上下文管理器(with语句)的原理与实践
jvm·数据库·python
m0_736919102 小时前
Python面向对象编程(OOP)终极指南
jvm·数据库·python
one____dream2 小时前
【网安】Reverse-非常规题目
linux·python·安全·网络安全·ctf
冷雨夜中漫步2 小时前
python反转列表reverse()和[::-1]哪个效率更高
开发语言·python