def effectscatter(rating):
    index0 = rating['Label'] == 0
    index1 = rating['Label'] == 1

    point = np.array([5.0, 0.0])

    es = pe.EffectScatter("Rating", title_pos='center', width=1200, height=600)
    for _, row in rating.loc[index1].iterrows():
        distance = np.linalg.norm(
            np.array([row['Average Score'], row['Standard Deviation']]) -
            point)
        size = 20.0 / (distance + 1.0)
        es.add(row['Name'], [row['Average Score']],
               [row['Standard Deviation']],
               sybol_size=size)
    for _, row in rating.loc[index0].iterrows():
        distance = np.linalg.norm(
            np.array([row['Average Score'], row['Standard Deviation']]) -
            point)
        size = 10.0 / (distance + 1.0)
        es.add(row['Name'], [row['Average Score']],
               [row['Standard Deviation']],
               symbol_size=size,
               effect_scale=0)
    es.add("", [], [],
           xaxis_name='Average Score',
           yaxis_name='Standard Deviation',
           is_legend_show=False)
    es.render()
    return es
Exemplo n.º 2
0
def demoa(data):
    es = pyecharts.EffectScatter("")
    flag = 0
    for title in data.items():
        if title[1] < 10: pass
        es.add(title[0], [flag], [title(1)],
               symbol_size=10,
               effect_scale=3.5,
               symbol="roundRect")
        flag += 1
    es.render()
Exemplo n.º 3
0
def t13(pa):
    scatter = p.EffectScatter("职位与需求量、薪水关系")
    next(pa)
    y = next(pa)
    y2 = next(pa)
    for i in range(len(y)):
        scatter.add("薪水", [y[i]], [y2[i]],
                    is_toolbox_show=False,
                    symbol_size=15,
                    effect_scale=3,
                    effect_period=3,
                    symbol=random.choice(['roundRect', 'pin']),
                    effect_brushtype='fill')

    return scatter
Exemplo n.º 4
0
def create_EffectScatter():
    es = pyecharts.EffectScatter("最低气温动态散点图",
                                 "2018-4-16",
                                 title_pos='right',
                                 title_color='blue',
                                 width=1400,
                                 height=700,
                                 background_color='white')
    es.add("最低温度",
           range(0, len(cities)),
           lows,
           legend_pos='center',
           legend_text_color='blue',
           symbol_size=10,
           effect_period=3,
           effect_scale=3.5,
           symbol='pin',
           is_datazoom_show=True,
           is_label_show=True)
    # es.render("EffectScatter-low.html")
    page.add(es)
Exemplo n.º 5
0
            mark_line=["average"],
            legend_top="50%",
        )

        grid = echarts.Grid()
        grid.add(bar, grid_bottom="60%")
        grid.add(line, grid_top="60%")
        grid.render(path='tmp/grid.html')

    # 左右类型,Scatter + EffectScatter
    if __name__ == '__main__':
        v1 = [5, 20, 36, 10, 75, 90]
        v2 = [10, 25, 8, 60, 20, 80]
        scatter = echarts.Scatter(width=1200)
        scatter.add("散点图示例", v1, v2, legend_pos="70%")
        es = echarts.EffectScatter()
        es.add(
            "动态散点图示例",
            [11, 11, 15, 13, 12, 13, 10],
            [1, -2, 2, 5, 3, 2, 0],
            effect_scale=6,
            legend_pos="20%",
        )

        grid = echarts.Grid()
        grid.add(scatter, grid_left="60%")
        grid.add(es, grid_right="60%")
        grid.render(path='tmp/grid.html')

    # 上下左右类型,Bar + Line + Scatter + EffectScatter
    if __name__ == '__main__':