Ejemplo n.º 1
0
Line3D.render('E:\\pye\\line3d.html')  # 在指定目录下生成文件

#coding:utf-8
from pyecharts import Gauge
# 仪表盘
gauge = Gauge('项目完成进度')
gauge.add('进度表', '完成率', 88.88)
gauge.render('E:\\pye\\gauge.html')  # 在指定目录下生成文件

#coding:utf-8
from pyecharts import Funnel
# 漏斗图
attr = ['认知', '了解', '认可', '考虑', '意向', '购买']
value = [120, 100, 80, 60, 40, 20]
funnel = Funnel('客户购买分析图')
funnel.add('买车',
           attr,
           value,
           is_label_show=True,
           label_pos='inside',
           label_text_color='#fff')
funnel.render('E:\\pye\\funel.html')  # 在指定目录下生成文件

#coding:utf-8
from pyecharts import Liquid

liquid = Liquid("水球图")
liquid.add("Liquid", [0.8])
liquid.show_config()
liquid.render('E:\\pye\\sq.html')  # 在指定目录下生成文件
Ejemplo n.º 2
0
    except:
        conn.rollback()


# 关闭数据库链接
def sql_close():
    cur.close()
    conn.close()


proc = 0.00

page = Page()

# 爬取进度
liquid = Liquid('网页爬取进度')
nowpro = sql_count() / 6977
proc = Decimal(nowpro).quantize(Decimal('0.00'))
liquid.add("爬取进度", [str(proc)])

# 3D 柱状图
bar3d = Bar3D("豆瓣评分", width=1620, height=720)
datalist = sql_select(0, 6977)
# 书名
x_axis = []
y_axis = []
data = []
y = 0
x = 0

# 词库云
Ejemplo n.º 3
0
from pyecharts import Liquid
liquid = Liquid("水球图实例")
liquid.add("liquid", [0.8])
liquid.render(r'C:\Users\Administrator\Desktop\数据可视化\pyecharts\html\13.html')
Ejemplo n.º 4
0
def test_more_charts():
    page = Page()

    # line
    line = Line("折线图示例")
    line.add(
        "最高气温",
        WEEK,
        [11, 11, 15, 13, 12, 13, 10],
        mark_point=["max", "min"],
        mark_line=["average"],
    )
    line.add(
        "最低气温",
        WEEK,
        [1, -2, 2, 5, 3, 2, 0],
        mark_point=["max", "min"],
        mark_line=["average"],
    )

    # pie
    v1 = [11, 12, 13, 10, 10, 10]
    pie = Pie("饼图-圆环图示例", title_pos="center")
    pie.add(
        "",
        CLOTHES,
        v1,
        radius=[40, 75],
        label_text_color=None,
        is_label_show=True,
        legend_orient="vertical",
        legend_pos="left",
    )

    page.add([line, pie])

    # kline
    v1 = [
        [2320.26, 2320.26, 2287.3, 2362.94],
        [2300, 2291.3, 2288.26, 2308.38],
        [2295.35, 2346.5, 2295.35, 2345.92],
        [2347.22, 2358.98, 2337.35, 2363.8],
        [2360.75, 2382.48, 2347.89, 2383.76],
        [2383.43, 2385.42, 2371.23, 2391.82],
        [2377.41, 2419.02, 2369.57, 2421.15],
        [2425.92, 2428.15, 2417.58, 2440.38],
        [2411, 2433.13, 2403.3, 2437.42],
        [2432.68, 2334.48, 2427.7, 2441.73],
        [2430.69, 2418.53, 2394.22, 2433.89],
        [2416.62, 2432.4, 2414.4, 2443.03],
        [2441.91, 2421.56, 2418.43, 2444.8],
        [2420.26, 2382.91, 2373.53, 2427.07],
        [2383.49, 2397.18, 2370.61, 2397.94],
        [2378.82, 2325.95, 2309.17, 2378.82],
        [2322.94, 2314.16, 2308.76, 2330.88],
        [2320.62, 2325.82, 2315.01, 2338.78],
        [2313.74, 2293.34, 2289.89, 2340.71],
        [2297.77, 2313.22, 2292.03, 2324.63],
        [2322.32, 2365.59, 2308.92, 2366.16],
        [2364.54, 2359.51, 2330.86, 2369.65],
        [2332.08, 2273.4, 2259.25, 2333.54],
        [2274.81, 2326.31, 2270.1, 2328.14],
        [2333.61, 2347.18, 2321.6, 2351.44],
        [2340.44, 2324.29, 2304.27, 2352.02],
        [2326.42, 2318.61, 2314.59, 2333.67],
        [2314.68, 2310.59, 2296.58, 2320.96],
        [2309.16, 2286.6, 2264.83, 2333.29],
        [2282.17, 2263.97, 2253.25, 2286.33],
        [2255.77, 2270.28, 2253.31, 2276.22],
    ]
    kline = Kline("K 线图示例")
    kline.add(
        "日K",
        ["2017/7/{}".format(i + 1) for i in range(31)],
        v1,
        is_datazoom_show=True,
    )
    page.add(kline)

    # radar
    schema = [
        ("销售", 6500),
        ("管理", 16000),
        ("信息技术", 30000),
        ("客服", 38000),
        ("研发", 52000),
        ("市场", 25000),
    ]
    v1 = [[4300, 10000, 28000, 35000, 50000, 19000]]
    v2 = [[5000, 14000, 28000, 31000, 42000, 21000]]
    radar = Radar("雷达图示例")
    radar.config(schema)
    radar.add("预算分配", v1, is_splitline=True, is_axisline_show=True)
    radar.add(
        "实际开销",
        v2,
        label_color=["#4e79a7"],
        is_area_show=False,
        legend_selectedmode="single",
    )
    page.add(radar)

    # scatter3d
    data = [[
        random.randint(0, 100),
        random.randint(0, 100),
        random.randint(0, 100),
    ] for _ in range(80)]
    scatter3D = Scatter3D("3D 散点图示例", width=1200, height=600)
    scatter3D.add("", data, is_visualmap=True, visual_range_color=RANGE_COLOR)
    page.add(scatter3D)

    # wordcloud
    name = [
        "Sam S Club",
        "Macys",
        "Amy Schumer",
        "Jurassic World",
        "Charter Communications",
        "Chick Fil A",
        "Planet Fitness",
        "Pitch Perfect",
        "Express",
        "Home",
        "Johnny Depp",
        "Lena Dunham",
        "Lewis Hamilton",
        "KXAN",
        "Mary Ellen Mark",
        "Farrah Abraham",
        "Rita Ora",
        "Serena Williams",
        "NCAA baseball tournament",
        "Point Break",
    ]
    value = [
        10000,
        6181,
        4386,
        4055,
        2467,
        2244,
        1898,
        1484,
        1112,
        965,
        847,
        582,
        555,
        550,
        462,
        366,
        360,
        282,
        273,
        265,
    ]
    wordcloud = WordCloud(width=1300, height=620)
    wordcloud.add("", name, value, word_size_range=[30, 100], rotate_step=66)
    page.add(wordcloud)

    # liquid
    liquid = Liquid("水球图示例")
    liquid.add("Liquid", [0.6])
    page.add(liquid)
    assert len(page) == 7
    assert isinstance(page[0], Line)
    assert (("echarts" in page.js_dependencies)
            or ("echarts.min" in page.js_dependencies))
    page.render()
Ejemplo n.º 5
0
def shuiqiu2():
    '''水球图'''
    liquid = Liquid("水球图示例")
    liquid.add("Liquid", [0.6, 0.5, 0.4, 0.3], is_liquid_outline_show=False)
    liquid.render('./info/水球图2.html')
Ejemplo n.º 6
0
def test_liquid_diamond_shape():
    liquid = Liquid("水球图示例")
    liquid.add("Liquid", [0.6, 0.5, 0.4, 0.3], is_liquid_animation=False,
               shape='diamond')
    assert "diamond" in liquid._repr_html_()
Ejemplo n.º 7
0
cut_text = " ".join(jieba.cut(deal, cut_all=False))
cut_text = re.sub('公寓', '', cut_text)
cut_text = re.sub('爱情', '', cut_text)
topword = jieba.analyse.extract_tags(deal, 35)
value = [cut_text.count(a) for a in topword]

#准备生成页面
from pyecharts import Page
page = Page()

#获得评分水球
from pyecharts import Liquid

liquid = Liquid(title + "---猫眼最新" + str(n) + '位用户预测评分',
                title_color="#fff",
                title_pos="center",
                width=1800,
                height=700)
nsum = 0
for i in range(0, len(rate)):
    nsum += i
lrate = nsum / len(rate)
liquid.add("评分值", [lrate / 100])
page.add_chart(liquid)
print(nsum)
print(lrate)
print(len(rate))
print(rate)
#生成观众评分图
from pyecharts import Pie
attr = ["五星", "四星", "三星", "两星", "一星"]
Ejemplo n.º 8
0
def iops_echart(request):

    template = loader.get_template('display_iops_thu.html')
    #conn = cx_Oracle.connect('system/oracle@trn')
    try:
        conn = database_method.initial_connect('system', 'oracle', 'trn')
        conn = conn.create_conn()
    except Exception as msg:
        print(msg)

    try:

        iops_tho_sec = """
                select "Time_Delta", "Metric", 
                   case when "Total" >10000000 then '* '||round("Total"/1024/1024,0)||' M' 
                        when "Total" between 10000 and 10000000 then '+ '||round("Total"/1024,0)||' K'
                        when "Total" between 10 and 1024 then '  '||to_char(round("Total",0))
                        else '  '||to_char("Total") 
                   end "Total"
            from (
             select to_char(min(begin_time),'hh24:mi:ss')||' /'||round(avg(intsize_csec/100),0)||'s' "Time_Delta",
                   metric_name||' - '||metric_unit "Metric", 
                   nvl(sum(value_inst1),0)+nvl(sum(value_inst2),0) "Total",
                   sum(value_inst1) inst1, sum(value_inst2) inst2
             from
              ( select begin_time,intsize_csec,metric_name,metric_unit,metric_id,group_id,
                   case inst_id when 1 then round(value,1) end value_inst1,
                   case inst_id when 2 then round(value,1) end value_inst2
              from gv$sysmetric
              where metric_name in ('Host CPU Utilization (%)','Current OS Load', 'Physical Write Total IO Requests Per Sec', 
                    'Physical Write Total Bytes Per Sec', 'Physical Write IO Requests Per Sec', 'Physical Write Bytes Per Sec',
                     'I/O Requests per Second', 'I/O Megabytes per Second',
                    'Physical Read Total Bytes Per Sec', 'Physical Read Total IO Requests Per Sec', 'Physical Read IO Requests Per Sec',
                    'CPU Usage Per Sec','Network Traffic Volume Per Sec','Logons Per Sec','Redo Generated Per Sec','Redo Writes Per Sec',
                    'User Transaction Per Sec','Average Active Sessions','Average Synchronous Single-Block Read Latency',
                    'Logical Reads Per Sec','DB Block Changes Per Sec') and group_id=2
              )
             group by metric_id,group_id,metric_name,metric_unit
             order by metric_name
            )
                """

        instance_status = """
        select instance_name,status,to_char(startup_time,'yyyy-mm-dd:HH24:MI:SS') startup_time from gv$instance
        """

        cursor = conn.cursor()
        cursor.execute(iops_tho_sec)
        iops_tho_sec_data = cursor.fetchall()

        iops_title = [i[0] for i in cursor.description]
        #iops_tho_data = pd.DataFrame(np.array(iops_tho_sec_data), columns=iops_title)
        iops_tho_data = []

        for idx in range(len(iops_tho_sec_data)):
            iops_tho_data.append({
                iops_title[0]: iops_tho_sec_data[idx][0],
                iops_title[1]: iops_tho_sec_data[idx][1],
                iops_title[2]: iops_tho_sec_data[idx][2]
            })
        #print(iops_tho_data)
        cursor.close()

        cursor = conn.cursor()
        cursor.execute(instance_status)
        instance_status_data = cursor.fetchall()
        inst_status_data = []

        inst_title = [i[0] for i in cursor.description]

        total = 0
        good = 0
        for idx in range(len(instance_status_data)):
            inst_status_data.append({
                inst_title[0]: instance_status_data[idx][0],
                inst_title[1]: instance_status_data[idx][1],
                inst_title[2]: instance_status_data[idx][2]
            })
            if instance_status_data[idx][1] == 'OPEN':
                good += 1
            total += 1

        health = good / total
        #print(health)

        # #水球图
        from pyecharts import Liquid

        liquid_instance = Liquid(width=200, height=50)
        liquid_instance.add("Liquid", [health])

        context = dict(iops_title=iops_title,
                       iops_tho_data=iops_tho_data,
                       inst_title=inst_title,
                       instance_status_data=inst_status_data,
                       msg='',
                       health_ball=liquid_instance.render_embed(),
                       host=REMOTE_HOST,
                       script_list=liquid_instance.get_js_dependencies())
        return HttpResponse(template.render(context, request))
    except Exception as msg:
        context = dict(msg=msg, sid='TRN Instance')
        return HttpResponse(template.render(context, request))
Ejemplo n.º 9
0
# 导入模块,引入类
from pyecharts import Liquid

# 创建水球图对象  (括号内为图名)
liObj = Liquid("人员工资占比图")

#创建的对象内放入数据
liObj.add("人员工资占比", [0.9])

#渲染到一个HTML页面
liObj.render("水球图.html")
Ejemplo n.º 10
0
def DrawLiquid(city_name):
    data = int(qr.get_data(city_name)['SD'].strip('%')) / 100
    liquid = Liquid('%s城市湿度' % city_name)
    liquid.add('湿度', [data])
    liquid.render('weatherLiquid.html')
Ejemplo n.º 11
0
def junk_video(ratio):
    liquid = Liquid("零收藏硬币分享的视频数占比")
    liquid.add("零收藏硬币分享", [ratio], is_liquid_outline_show=False)
    liquid.render(r'junk_video.html')
Ejemplo n.º 12
0
# 阶梯图,修改为True查看
if False:
	line=Line('折线图-阶梯图示例')
	line.add('商家A',attr,v1,is_strp=True,is_label_show=True)
	line.show_config()
	line.render()
# 面积图,修改为True查看
if False:
	line=Line('折线图-面积图示例')
	line.add('商家A',attr,v1,is_fill=True,line_opacity=0.2,area_opacity=0.4,symbol=None)
	line.add('商家B',attr,v2,is_fill=True,area_color='#000',area_opacity=0.3,is_smooth=True)
	line.show_config()
	line.render()
# 圆形水球图,修改为True查看
if False:
	liquid=Liquid('水球-圆形图示例')
	liquid.add('Liquid',[0.8,0.2],is_liquid_outline_show=True)
	liquid.show_config()
	liquid.render()
# 砖石水球图,修改为True查看
if False:
	liquid=Liquid('水球-砖石图示例')
	liquid.add('Liquid',[0.8,0.2],is_liquid_outline_show=True,shape='diamond')
	liquid.show_config()
	liquid.render()
# 中国地图,修改为True查看
value=[10,20,30,40,50,60,70,80,90,100]
prov=['广西','广东','福建','湖南','江西','云南','贵州','浙江','安徽','湖北']
if False:
	map=Map('Map结合Visualmap示例',width=1200,height=600)
	map.add('',prov,value,maptype='china',is_visualmap=True,visual_text_color='#000')
from pyecharts import Liquid, Polar, Radar, Scatter

liquid =Liquid("水球图")
liquid.add("Liquid", [0.6])
liquid.show_config()
liquid.render(path='./data/03-01水球.html')

# 圆形水球
liquid2 =Liquid("水球图示例")
liquid2.add("Liquid", [0.6, 0.5, 0.4, 0.3], is_liquid_outline_show=False)
liquid2.show_config()
liquid2.render(path='./data/03-02圆形水球.html')

# 菱形水球
liquid3 =Liquid("水球图示例")
liquid3.add("Liquid", [0.6, 0.5, 0.4, 0.3], is_liquid_animation=False, shape='diamond')
liquid3.show_config()
liquid3.render(path='./data/03-03菱形水球.html')

# 极坐标
radius =['周一', '周二', '周三', '周四', '周五', '周六', '周日']
polar =Polar("极坐标系-堆叠柱状图示例", width=1200, height=600)
polar.add("A", [1, 2, 3, 4, 3, 5, 1], radius_data=radius, type='barRadius', is_stack=True)
polar.add("B", [2, 4, 6, 1, 2, 3, 1], radius_data=radius, type='barRadius', is_stack=True)
polar.add("C", [1, 2, 3, 4, 1, 2, 5], radius_data=radius, type='barRadius', is_stack=True)
polar.show_config()
polar.render(path='./data/03-04极坐标.html')

# 雷达图
schema =[ ("销售", 6500), ("管理", 16000), ("信息技术", 30000), ("客服", 38000), ("研发", 52000), ("市场", 25000)]
v1 =[[4300, 10000, 28000, 35000, 50000, 19000]]
Ejemplo n.º 14
0
def shuiqiu3():
    '''水球图'''
    liquid = Liquid("水球图示例")
    liquid.add("Liquid", [0.6, 0.5, 0.4, 0.3], is_liquid_animation=False, shape='diamond')
    liquid.render('./info/水球图3.html')
Ejemplo n.º 15
0
from pyecharts import Liquid

liquid = Liquid("水球图", title_pos='center')
# shape设置水球形状,可以自定义svg,is_liquid_animation开启动画,is_liquid_outline_show显示边框
liquid.add("水球", [0.8, 0.3],
           shape='roundRect',
           is_liquid_animation=True,
           is_liquid_outline_show=True)
liquid.render("./liquid.html")
Ejemplo n.º 16
0
def test_more():
    page = Page()

    # line
    attr = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
    line = Line("折线图示例")
    line.add("最高气温", attr, [11, 11, 15, 13, 12, 13, 10],
             mark_point=["max", "min"], mark_line=["average"])
    line.add("最低气温", attr, [1, -2, 2, 5, 3, 2, 0],
             mark_point=["max", "min"], mark_line=["average"])
    page.add(line)

    # pie
    attr = ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
    v1 = [11, 12, 13, 10, 10, 10]
    pie = Pie("饼图-圆环图示例", title_pos='center')
    pie.add("", attr, v1, radius=[40, 75], label_text_color=None,
            is_label_show=True, legend_orient='vertical', legend_pos='left')
    page.add(pie)

    # kline
    v1 = [[2320.26, 2320.26, 2287.3, 2362.94],
          [2300, 2291.3, 2288.26, 2308.38],
          [2295.35, 2346.5, 2295.35, 2345.92],
          [2347.22, 2358.98, 2337.35, 2363.8],
          [2360.75, 2382.48, 2347.89, 2383.76],
          [2383.43, 2385.42, 2371.23, 2391.82],
          [2377.41, 2419.02, 2369.57, 2421.15],
          [2425.92, 2428.15, 2417.58, 2440.38],
          [2411, 2433.13, 2403.3, 2437.42],
          [2432.68, 2334.48, 2427.7, 2441.73],
          [2430.69, 2418.53, 2394.22, 2433.89],
          [2416.62, 2432.4, 2414.4, 2443.03],
          [2441.91, 2421.56, 2418.43, 2444.8],
          [2420.26, 2382.91, 2373.53, 2427.07],
          [2383.49, 2397.18, 2370.61, 2397.94],
          [2378.82, 2325.95, 2309.17, 2378.82],
          [2322.94, 2314.16, 2308.76, 2330.88],
          [2320.62, 2325.82, 2315.01, 2338.78],
          [2313.74, 2293.34, 2289.89, 2340.71],
          [2297.77, 2313.22, 2292.03, 2324.63],
          [2322.32, 2365.59, 2308.92, 2366.16],
          [2364.54, 2359.51, 2330.86, 2369.65],
          [2332.08, 2273.4, 2259.25, 2333.54],
          [2274.81, 2326.31, 2270.1, 2328.14],
          [2333.61, 2347.18, 2321.6, 2351.44],
          [2340.44, 2324.29, 2304.27, 2352.02],
          [2326.42, 2318.61, 2314.59, 2333.67],
          [2314.68, 2310.59, 2296.58, 2320.96],
          [2309.16, 2286.6, 2264.83, 2333.29],
          [2282.17, 2263.97, 2253.25, 2286.33],
          [2255.77, 2270.28, 2253.31, 2276.22]]
    kline = Kline("K 线图示例")
    kline.add("日K", ["2017/7/{}".format(i + 1) for i in range(31)],
              v1, is_datazoom_show=True)
    page.add(kline)

    # radar
    schema = [
        ("销售", 6500), ("管理", 16000), ("信息技术", 30000),
        ("客服", 38000), ("研发", 52000), ("市场", 25000)
    ]
    v1 = [[4300, 10000, 28000, 35000, 50000, 19000]]
    v2 = [[5000, 14000, 28000, 31000, 42000, 21000]]
    radar = Radar("雷达图示例")
    radar.config(schema)
    radar.add("预算分配", v1, is_splitline=True, is_axisline_show=True)
    radar.add("实际开销", v2, label_color=["#4e79a7"], is_area_show=False,
              legend_selectedmode='single')
    page.add(radar)

    # scatter3d
    import random
    data = [
        [random.randint(0, 100),
         random.randint(0, 100),
         random.randint(0, 100)] for _ in range(80)
    ]
    scatter3D = Scatter3D("3D 散点图示例", width=1200, height=600)
    scatter3D.add("", data, is_visualmap=True, visual_range_color=RANGE_COLOR)
    page.add(scatter3D)

    # wordcloud
    name = [
        'Sam S Club', 'Macys', 'Amy Schumer', 'Jurassic World',
        'Charter Communications', 'Chick Fil A', 'Planet Fitness',
        'Pitch Perfect', 'Express', 'Home', 'Johnny Depp', 'Lena Dunham',
        'Lewis Hamilton', 'KXAN', 'Mary Ellen Mark', 'Farrah Abraham',
        'Rita Ora', 'Serena Williams', 'NCAA baseball tournament', 'Point Break'
    ]
    value = [
        10000, 6181, 4386, 4055, 2467, 2244, 1898, 1484, 1112,
        965, 847, 582, 555, 550, 462, 366, 360, 282, 273, 265
    ]
    wordcloud = WordCloud(width=1300, height=620)
    wordcloud.add("", name, value, word_size_range=[30, 100], rotate_step=66)
    page.add(wordcloud)

    # liquid
    liquid = Liquid("水球图示例")
    liquid.add("Liquid", [0.6])
    page.add(liquid)
    page.render()
Ejemplo n.º 17
0
def test_liquid_multiple_data():
    liquid = Liquid("水球图示例")
    liquid.add("Liquid", [0.6, 0.5, 0.4, 0.3], is_liquid_outline_show=False)
    assert "diamond" not in liquid._repr_html_()
Ejemplo n.º 18
0
 def img8():
     liquid3 = Liquid("height", width="100%")
     liquid3.add("Liquid", [0.6])
     return liquid3.render_embed()
Ejemplo n.º 19
0
def test_liquid_default():
    liquid = Liquid("水球图示例")
    liquid.add("Liquid", [0.6])
    liquid.render()
Ejemplo n.º 20
0
Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> # Part 12 Create WaterBall with Pyecharts
>>> from pyecharts import Liquid
>>> lq=Liquid("WaterBall")
>>> lq.add("Liquid", [0.8, 0.5, 0.2], is_liquid_outline_show=False, is_liquid_animation=True)
<pyecharts.charts.liquid.Liquid object at 0x008C8F50>
>>> lq.render()
>>> 
Ejemplo n.º 21
0
from pyecharts import Liquid

from liquidView.sours import *

name =input("请输入姓名:")

data = queryEmpSalary(name)

# print("----------",data)

if data is None:
    print("用户不存在")
else:
    lidata = []
    lidata.append(data)
    print(lidata)

    liObj = Liquid("员工工资占比图")

    liObj.add("员工工资占比", lidata)

    liObj.render(name + ".html")
Ejemplo n.º 22
0
"""
文件名: $NAME.py
日期: 22  
作者: lvah
联系: [email protected]
代码描述: 



"""

from pyecharts import Liquid
import psutil

# cpu_percent = psutil.cpu_percent()
# print(cpu_percent)

from pyecharts import Liquid

# liquid = Liquid("xxxx")
# liquid.add("Liquid", [0.6])
# liquid.render()

from pyecharts import Liquid

liquid = Liquid("xxxx")
liquid.add("Liquid", [0.6, 0.5, 0.4, 0.3], shape='pin')
liquid.render()
Ejemplo n.º 23
0
    random.randint(0, 100),
    random.randint(0, 100)
] for _ in range(80)]
scatter3D = Scatter3D("3D 散点图示例", width=1200, height=600)
scatter3D.add("", data, is_visualmap=True, visual_range_color=RANGE_COLOR)
page.add(scatter3D)

# wordcloud
name = [
    'Sam S Club', 'Macys', 'Amy Schumer', 'Jurassic World',
    'Charter Communications', 'Chick Fil A', 'Planet Fitness', 'Pitch Perfect',
    'Express', 'Home', 'Johnny Depp', 'Lena Dunham', 'Lewis Hamilton', 'KXAN',
    'Mary Ellen Mark', 'Farrah Abraham', 'Rita Ora', 'Serena Williams',
    'NCAA baseball tournament', 'Point Break'
]
value = [
    10000, 6181, 4386, 4055, 2467, 2244, 1898, 1484, 1112, 965, 847, 582, 555,
    550, 462, 366, 360, 282, 273, 265
]
wordcloud = WordCloud(width=1300, height=620)
wordcloud.add("", name, value, word_size_range=[30, 100], rotate_step=66)
page.add(wordcloud)

# liquid
liquid = Liquid("水球图示例")
liquid.add("Liquid", [0.6])
page.add(liquid)
page.render()

os.system('scrappeteer render.html')
Ejemplo n.º 24
0
def shuiqiu1():
    '''水球图'''
    liquid = Liquid("水球图示例")
    liquid.add("Liquid", [0.6])
    # liquid.show_config()
    liquid.render('./info/水球图1.html')