Example #1
0
def ewide5(request):

    template = loader.get_template('ewpyecharts.html')
    style = Style(title_top="#fff",
                  title_pos="center",
                  width=1200,
                  height=600,
                  background_color="#404a59")
    style_geo = style.add(
        is_label_show=True,
        line_curve=0.2,
        line_opacity=0.6,
        legend_text_color="#eee",
        legend_pos="right",
        geo_effect_symbol="plane",
        geo_effect_symbolsize=15,
        label_color=['#a6c84c', '#ffa022', '#46bee9'],
        label_pos="right",
        label_formatter="{b}",
        label_text_color="#eee",
    )
    data_guangzhou = [["广州", "上海"], ["广州", "北京"], ["广州", "南京"], ["广州", "重庆"],
                      ["广州", "兰州"], ["广州", "杭州"]]
    data_beijing = [["北京", "上海"], ["北京", "广州"], ["北京", "南京"], ["北京", "重庆"],
                    ["北京", "兰州"], ["北京", "杭州"]]
    geolines1 = GeoLines("GeoLines 示例", **style.init_style)
    geolines1.add("从广州出发", data_guangzhou, **style_geo)
    geolines1.add("从北京出发", data_beijing, **style_geo)

    # geo.show_config()
    context = dict(myechart=geolines1.render_embed(),
                   host=REMOTE_HOST,
                   script_list=geolines1.get_js_dependencies())
    return HttpResponse(template.render(context, request))
Example #2
0
def ewide2(request):
    template = loader.get_template('ewpyecharts.html')

    style = Style(
        title_top="#fff",
        title_pos="center",
        width=1200,
        height=600,
        background_color="#404a59"
    )

    data_guangzhou = [
        ["广州", "上海"],
        ["广州", "北京"],
        ["广州", "南京"],
        ["广州", "重庆"],
        ["广州", "兰州"],
        ["广州", "杭州"]
    ]
    geolines = GeoLines("水务地图可视化--点线图", **style.init_style)
    geolines.add("从广州出发", data_guangzhou, is_legend_show=False)

    context = dict(
        myechart=geolines.render_embed(),
        host=REMOTE_HOST,
        script_list=geolines.get_js_dependencies()
    )
    return HttpResponse(template.render(context, request))
Example #3
0
def geolines():
    data_beijing = [["北京", "上海"], ["北京", "广州"], ["北京", "南京"], ["北京", "重庆"],
                    ["北京", "兰州"], ["北京", "杭州"]]

    data_guangzhou = [
        ["广州", "上海", 10],
        ["广州", "北京", 20],
        ["广州", "南京", 30],
        ["广州", "重庆", 40],
        ["广州", "兰州", 50],
        ["广州", "杭州", 60],
    ]
    style = Style(title_top="#fff",
                  title_pos="center",
                  width=1200,
                  height=600,
                  background_color="#404a59")

    style_geo = style.add(
        is_label_show=True,
        line_curve=0.2,
        line_opacity=0.6,
        legend_text_color="#eee",
        legend_pos="right",
        geo_effect_symbol="plane",
        geo_effect_symbolsize=15,
        label_color=['#a6c84c', '#ffa022', '#46bee9'],
        label_pos="right",
        label_formatter="{b}",
        label_text_color="#eee",
    )
    geolines = GeoLines("GeoLines", **style.init_style)
    geolines.add("从广州出发", data_guangzhou, **style_geo)
    geolines.add("从北京出发", data_beijing, **style_geo)
    # geolines.render()
    return render_template(
        'geolines.html',
        geolines=geolines.render_embed(),
        host=REMOTE_HOST,
        script_list=geolines.get_js_dependencies(),
    )