提示:仅供我的舍友学习使用。


1.Funnel:漏斗图(一)

代码如下(示例):

from PreTest import *
from pyecharts import options as opts
from pyecharts.render import make_snapshot
from snapshot_phantomjs import snapshotfrom pyecharts.charts import Funnelfrom pyecharts.faker import Fakerdata = [list(z) for z in zip(Faker.choose(), Faker.values())
]def funnel_chart() -> Funnel:# ********* Begin *********#  funnel = (Funnel().add("商品", data).set_global_opts(title_opts=opts.TitleOpts(title="Funnel-基本示例",subtitle="Funnel-副标题")))# ********** End **********#return funnelmake_snapshot(snapshot, funnel_chart().render("Result/render.html"), 'StudentAnswer/student_answer.png') # 输出图片
make_snapshot(snapshot, funnel_base(data).render(), "StandardAnswer/task1/standard_answer_1.png")

2.Funnel:漏斗图(二)

代码如下(示例):

from PreTest import *
from pyecharts import options as opts
from pyecharts.render import make_snapshot
from snapshot_phantomjs import snapshotfrom pyecharts.charts import Funnelx_data = ["展现", "点击", "访问", "咨询", "订单"]
y_data = [100, 80, 60, 40, 20]data = [[x_data[i], y_data[i]] for i in range(len(x_data))]def funnel_chart() -> Funnel:# ********* Begin *********#  funnel = (Funnel(init_opts=opts.InitOpts(width="1600px", height="800px")).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="漏斗图", subtitle="纯属虚构")))# ********** End **********#return funnelmake_snapshot(snapshot, funnel_chart().render("Result/render.html"), "StudentAnswer/student_answer.png") # 输出图片
make_snapshot(snapshot, funnel_label_inside_chart(data).render(), "StandardAnswer/task2/standard_answer_2.png")

3.Funnel:漏斗图(三)

代码如下(示例):

from PreTest import *
from pyecharts import options as opts
from pyecharts.render import make_snapshot
from snapshot_phantomjs import snapshotfrom pyecharts.charts import Funnelfrom pyecharts.faker import Faker# ********* Begin *********#
x_data=["目标客户","潜在客户","意向客户","成交客户","忠诚客户"]
y_data=[5000,4600,2800,2100,1100]
data = [[x_data[i],y_data[i]] for i in range(len(x_data))]
# ********** End **********#def funnel_chart() -> Funnel:# ********* Begin *********#  funnel = (Funnel().add("客户",data,sort_="ascending",label_opts=opts.LabelOpts(position="inside"),).set_global_opts(title_opts=opts.TitleOpts(title="Funnel-Sort(ascending)")))# ********** End **********#return funnelmake_snapshot(snapshot, funnel_chart().render("Result/render.html"), 'StudentAnswer/student_answer.png') # 输出图片
make_snapshot(snapshot, funnel_sort_ascending().render(), "StandardAnswer/task3/standard_answer_3.png")

开始你的任务吧,祝你成功!

PyEcharts 基本图表之漏斗图相关推荐

  1. Pyecharts基本图:漏斗图

    Pyecharts基本图:漏斗图 文章目录 Pyecharts基本图:漏斗图 前言 一. Funnel:漏斗图 1.1 `Funnel` 类 1.2 `add` 函数 二. 案例 2.1 基本图 2. ...

  2. Python数据可视化 Pyecharts 制作 Funnel 漏斗图

    大家好,我是Mr数据杨.记得赤壁之战吗?那时候周瑜运筹帷幄,用火攻破了曹军的船队,就像Python中的'基本设置'一样,周瑜先建立了自己的基本军事配置,而这一配置也是整个计策的起始点. 接着,周瑜精心 ...

  3. PyEcharts 基本图表之雷达图

    第1关 Radar:雷达图(一) from PreTest import * from pyecharts import options as opts from pyecharts.render i ...

  4. PyEcharts 基本图表之日历图

    提示:仅供我的舍友学习使用. 1.Calendar:日历图(一) 代码如下(示例): from PreTest import * from pyecharts import options as op ...

  5. python 漏斗图

    转载 https://blog.csdn.net/qq_41080850/article/details/83933017 本文主要用到的是pyecharts包,所以要保证电脑上已经安装了pyecha ...

  6. Python实现漏斗图的绘制

    说明:代码运行环境为 Win10+Python3+jupyter notebook 本文主要用到的是pyecharts包,所以要保证电脑上已经安装了pyecharts包. 漏斗图简介:     漏斗图 ...

  7. Pyecharts:pyecharts(图文+代码)实战(柱状图/条形图/散点图、漏斗图、仪表盘、折线/面积图、水球图、地图、平行坐标系、饼图、极坐标系、雷达图、词云图)之绘制各种吊炸天的图表

    Pyecharts:pyecharts(图文+代码)实战(柱状图/条形图/散点图.漏斗图.仪表盘.折线/面积图.水球图.地图.平行坐标系.饼图.极坐标系.雷达图.词云图)之绘制各种吊炸天的图表 目录 ...

  8. pyecharts第四节、漏斗图

    创建[demo4.py]测试类 输入以下编码: from pyecharts import Funnel funnel = Funnel("中国人口组成比例(单位:亿)漏斗图", ...

  9. pyecharts绘制日历图、漏斗图、仪表盘、水滴图

    日历图 import datetime import random from pyecharts.charts import Calendar from pyecharts import option ...

最新文章

  1. python selenium 等待页面加载完毕_Selenium_等待页面加载完毕
  2. 斯坦福大学机器学习第五课正则化“
  3. windows server 2008 (五)web服务器的搭建和部署
  4. 循环删除List集合的错误
  5. Spring Cloud笔记-Maven构建父子项目
  6. exit、_exit、abort、return的区别
  7. AndroidStudio安卓原生开发_SwipeRefreshLayout_下拉刷新控件---Android原生开发工作笔记119
  8. 中国速度袋行业市场供需与战略研究报告
  9. Java技术简介及Tomcat部署
  10. Android手机中第三方签名应用程序无法获得的permission
  11. vue-resource HTTP API基础
  12. pymysql安装_jqdatasdk手动安装
  13. 天翼校园网连接不上服务器无响应,天翼校园网dns解析出错怎么办
  14. 面试官:ca证书存储在哪的
  15. JS编写 简易网页音乐播放器
  16. 职场常用问题分析与管理方法
  17. SQL求和一个表之后和另一个表数据进行关联
  18. Ubuntu Desktop gedit
  19. swift 隐藏状态栏_swift 同时修改状态栏和导航栏出现的问题及解决的方法
  20. [转]脑梗塞的诊治指南

热门文章

  1. 各种Oracle索引类型介绍
  2. 【千律】C++基础:map 循环遍历删除元素,及其报错的解决方案
  3. oracle锁表解锁
  4. 《腾讯网UED体验设计之旅》总结:尼尔森启发式评估十原则
  5. 倾角传感器的六大应用场合
  6. 饿了么投怀阿里,外卖大战说打就打!
  7. python中的画布是什么_python详解:turtle库中的画布
  8. 云姓“自”还是姓“开”?析华为云的开源观
  9. 奋斗正当时,城链科技战略峰会广州站圆满召开
  10. 铁岭python培训班