當前位置: 首頁>>代碼示例>>Python>>正文


Python Line.render方法代碼示例

本文整理匯總了Python中pyecharts.Line.render方法的典型用法代碼示例。如果您正苦於以下問題:Python Line.render方法的具體用法?Python Line.render怎麽用?Python Line.render使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyecharts.Line的用法示例。


在下文中一共展示了Line.render方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_line_negative_value

# 需要導入模塊: from pyecharts import Line [as 別名]
# 或者: from pyecharts.Line import render [as 別名]
def test_line_negative_value():
    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"])
    line.render()
開發者ID:chumingke,項目名稱:pyecharts,代碼行數:9,代碼來源:test_line.py

示例2: test_line_user_define_markpoint

# 需要導入模塊: from pyecharts import Line [as 別名]
# 或者: from pyecharts.Line import render [as 別名]
def test_line_user_define_markpoint():
    line = Line("折線圖示例")
    line.add("商家A", CLOTHES, clothes_v1,
             mark_point=["average", {
                 "coord": ["褲子", 10], "name": "這是我想要的第一個標記點"}])
    line.add("商家B", CLOTHES, clothes_v2, is_smooth=True,
             mark_point=[{
                 "coord": ["襪子", 80], "name": "這是我想要的第二個標記點"}])
    line.render()
開發者ID:chumingke,項目名稱:pyecharts,代碼行數:11,代碼來源:test_line.py

示例3: test_line_log_yaxis

# 需要導入模塊: from pyecharts import Line [as 別名]
# 或者: from pyecharts.Line import render [as 別名]
def test_line_log_yaxis():
    import math
    import random
    line = Line("折線圖示例")
    line.add("商家A", CLOTHES,
             [math.log10(random.randint(1, 99999)) for _ in range(6)])
    line.add("商家B", CLOTHES,
             [math.log10(random.randint(1, 99999999)) for _ in range(6)],
             yaxis_type="log")
    line.render()
開發者ID:chumingke,項目名稱:pyecharts,代碼行數:12,代碼來源:test_line.py

示例4: test_line_user_define_marks

# 需要導入模塊: from pyecharts import Line [as 別名]
# 或者: from pyecharts.Line import render [as 別名]
def test_line_user_define_marks():
    line = Line("折線圖示例")
    line.add("商家A", CLOTHES, clothes_v1,
             mark_point=["average", "max", "min"],
             mark_point_symbol='diamond', mark_point_textcolor='#40ff27')
    line.add("商家B", CLOTHES, clothes_v2,
             mark_point=["average", "max", "min"],
             mark_point_symbol='arrow', mark_point_symbolsize=40)
    line.show_config()
    line.render()
開發者ID:chumingke,項目名稱:pyecharts,代碼行數:12,代碼來源:test_line.py

示例5: draw_sentiment_pic

# 需要導入模塊: from pyecharts import Line [as 別名]
# 或者: from pyecharts.Line import render [as 別名]
def draw_sentiment_pic(csv_file):
    attr, val = [], []
    info = count_sentiment(csv_file)
    info = sorted(info.items(), key=lambda x: x[0], reverse=False)  # dict的排序方法
    for each in info[:-1]:
        attr.append(each[0])
        val.append(each[1])
    line = Line(csv_file+":影評情感分析")
    line.add("", attr, val, is_smooth=True, is_more_utils=True)
    line.render(csv_file+"_情感分析曲線圖.html")
開發者ID:miaomao1989,項目名稱:DA_projects,代碼行數:12,代碼來源:visualization_analysis.py

示例6: test_line_marks

# 需要導入模塊: from pyecharts import Line [as 別名]
# 或者: from pyecharts.Line import render [as 別名]
def test_line_marks():
    line = Line("折線圖示例")
    line.add("商家A", CLOTHES, clothes_v1, mark_point=["average"])
    line.add(
        "商家B",
        CLOTHES,
        clothes_v2,
        is_smooth=True,
        mark_line=["max", "average"],
    )
    line.render()
開發者ID:Jesszen,項目名稱:pyecharts,代碼行數:13,代碼來源:test_line.py

示例7: load_js

# 需要導入模塊: from pyecharts import Line [as 別名]
# 或者: from pyecharts.Line import render [as 別名]
import sys
import glob
import os
from pyecharts import Line

def load_js(jsfile):
    x_axis = []
    points = []
    with open(jsfile, 'r') as fp:
        while True:
            l = fp.readline()
            if not l:
                break
            deal_dict = json.loads(l)
            x_axis.append(deal_dict['dealDate'][0])
            points.append(deal_dict['unitPrice'][0])
    return x_axis, points

if __name__ == '__main__':
    dir_path = sys.argv[1]
    curve_name = ''
    line = Line("Deal Curve")
    cwd = os.getcwd()
    os.chdir(dir_path)
    for js in glob.glob("*.json"):
        x_axis, points = load_js(js)
        curve_name = js[:js.find(".json")]
        line.add(curve_name, x_axis, points, is_stack=True, is_label_show=True)
    os.chdir(cwd)
    line.render()
開發者ID:yunyan,項目名稱:wbmonitor,代碼行數:32,代碼來源:draw_deal_data.py

示例8: test_line_type_stack

# 需要導入模塊: from pyecharts import Line [as 別名]
# 或者: from pyecharts.Line import render [as 別名]
def test_line_type_stack():
    line = Line("折線圖-數據堆疊示例")
    line.add("商家A", CLOTHES, clothes_v1, is_stack=True, is_label_show=True)
    line.add("商家B", CLOTHES, clothes_v2, is_stack=True, is_label_show=True)
    line.render()
開發者ID:chumingke,項目名稱:pyecharts,代碼行數:7,代碼來源:test_line.py

示例9: test_grid

# 需要導入模塊: from pyecharts import Line [as 別名]
# 或者: from pyecharts.Line import render [as 別名]
def test_grid():

    # grid_0
    attr = ["襯衫", "羊毛衫", "雪紡衫", "褲子", "高跟鞋", "襪子"]
    v1 = [5, 20, 36, 10, 75, 90]
    v2 = [10, 25, 8, 60, 20, 80]
    bar = Bar("柱狀圖示例", height=720, is_grid=True)
    bar.add("商家A", attr, v1, is_stack=True, grid_bottom="60%")
    bar.add("商家B", attr, v2, is_stack=True, grid_bottom="60%")
    line = Line("折線圖示例", title_top="50%")
    attr = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
    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"], legend_top="50%")
    bar.grid(line.get_series(), grid_top="60%")
    bar.show_config()
    bar.render()

    # grid_1
    v1 = [5, 20, 36, 10, 75, 90]
    v2 = [10, 25, 8, 60, 20, 80]
    scatter = Scatter(width=1200, is_grid=True)
    scatter.add("散點圖示例", v1, v2, grid_left="60%", legend_pos="70%")
    es = EffectScatter()
    es.add("動態散點圖示例", [11, 11, 15, 13, 12, 13, 10], [1, -2, 2, 5, 3, 2, 0],
           effect_scale=6, legend_pos="20%")
    scatter.grid(es.get_series(), grid_right="60%")
    scatter.show_config()
    scatter.render()

    # grid_2
    attr = ["襯衫", "羊毛衫", "雪紡衫", "褲子", "高跟鞋", "襪子"]
    v1 = [5, 20, 36, 10, 75, 90]
    v2 = [10, 25, 8, 60, 20, 80]
    bar = Bar("柱狀圖示例", height=720, width=1200, title_pos="65%", is_grid=True)
    bar.add("商家A", attr, v1, is_stack=True, grid_bottom="60%", grid_left="60%")
    bar.add("商家B", attr, v2, is_stack=True, grid_bottom="60%", grid_left="60%", legend_pos="80%")
    line = Line("折線圖示例")
    attr = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
    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"], legend_pos="20%")
    v1 = [5, 20, 36, 10, 75, 90]
    v2 = [10, 25, 8, 60, 20, 80]
    scatter = Scatter("散點圖示例", title_top="50%", title_pos="65%")
    scatter.add("scatter", v1, v2, legend_top="50%", legend_pos="80%")
    es = EffectScatter("動態散點圖示例", title_top="50%")
    es.add("es", [11, 11, 15, 13, 12, 13, 10], [1, -2, 2, 5, 3, 2, 0], effect_scale=6,
           legend_top="50%", legend_pos="20%")
    bar.grid(line.get_series(), grid_bottom="60%", grid_right="60%")
    bar.grid(scatter.get_series(), grid_top="60%", grid_left="60%")
    bar.grid(es.get_series(), grid_top="60%", grid_right="60%")
    bar.show_config()
    bar.render()

    # grid_3
    line = Line("折線圖示例", width=1200, is_grid=True)
    attr = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
    line.add("最高氣溫", attr, [11, 11, 15, 13, 12, 13, 10], mark_point=["max", "min"],
             mark_line=["average"], grid_right="65%")
    line.add("最低氣溫", attr, [1, -2, 2, 5, 3, 2, 0], mark_point=["max", "min"],
             mark_line=["average"], legend_pos="20%")
    attr = ["襯衫", "羊毛衫", "雪紡衫", "褲子", "高跟鞋", "襪子"]
    v1 = [11, 12, 13, 10, 10, 10]
    pie = Pie("餅圖示例", title_pos="45%")
    pie.add("", attr, v1, radius=[30, 55], legend_pos="65%", legend_orient='vertical')
    line.grid(pie.get_series(), grid_left="60%")
    line.show_config()
    line.render()

    # grid_4
    line = Line("折線圖示例", width=1200, is_grid=True)
    attr = ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
    line.add("最高氣溫", attr, [11, 11, 15, 13, 12, 13, 10], mark_point=["max", "min"],
             mark_line=["average"], grid_right="60%")
    line.add("最低氣溫", attr, [1, -2, 2, 5, 3, 2, 0], mark_point=["max", "min"],
             mark_line=["average"], legend_pos="20%", grid_right="60%")
    attr = ["襯衫", "羊毛衫", "雪紡衫", "褲子", "高跟鞋", "襪子"]
    value = [20, 40, 60, 80, 100, 120]
    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],
#.........這裏部分代碼省略.........
開發者ID:ljwdoc,項目名稱:pyecharts,代碼行數:103,代碼來源:test_grid.py

示例10: test_line

# 需要導入模塊: from pyecharts import Line [as 別名]
# 或者: from pyecharts.Line import render [as 別名]
def test_line():

    # line_0
    attr = ["襯衫", "羊毛衫", "雪紡衫", "褲子", "高跟鞋", "襪子"]
    v1 = [5, 20, 36, 10, 10, 100]
    v2 = [55, 60, 16, 20, 15, 80]
    line = Line("折線圖示例")
    line.add("商家A", attr, v1, mark_point=["average"])
    line.add("商家B", attr, v2, is_smooth=True, mark_line=["max", "average"])
    line.show_config()
    line.render()

    # line_0_1
    line = Line("折線圖示例")
    line.add("商家A", attr, v1, mark_point=["average", "max", "min"],
             mark_point_symbol='diamond', mark_point_textcolor='#40ff27')
    line.add("商家B", attr, v2, mark_point=["average", "max", "min"],
             mark_point_symbol='arrow', mark_point_symbolsize=40)
    line.show_config()
    line.render()

    # line_1
    line = Line("折線圖-數據堆疊示例")
    line.add("商家A", attr, v1, is_stack=True, is_label_show=True)
    line.add("商家B", attr, v2, is_stack=True, is_label_show=True)
    line.show_config()
    line.render()

    # line_2
    line = Line("折線圖-階梯圖示例")
    line.add("商家A", attr, v1, is_step=True, is_label_show=True)
    line.show_config()
    line.render()

    # # line_3
    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()

    # line_4
    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"])
    line.show_config()
    line.render()
開發者ID:ljwdoc,項目名稱:pyecharts,代碼行數:50,代碼來源:test_line.py

示例11: range

# 需要導入模塊: from pyecharts import Line [as 別名]
# 或者: from pyecharts.Line import render [as 別名]
#折線圖適合描述兩個變量之間的函數關係,例如常用它來描述一個變量隨時間的變化趨勢。

from  pyecharts import Line

x = ['2018-{:0>2d}'.format(s) for s in range(1,13)]
y1 = [5,10,26,30,35,30,20,26,40,46,40,50]
y2 = [8,20,24,36,40,36,40,45,50,53,48,58]

line = Line(title = "月銷售總額",width = 600,height = 420)

line.add(name = "商家A", x_axis = x, y_axis = y1,
         line_width = 3,line_color = 'red',
         #=====設置markPoint&markLine=====
         mark_point = ['min','max'], #標記點
         mark_line = ['average']     #標記線
        )

line.add(name = "商家B", x_axis = x, y_axis = y2,
         yaxis_min = 0,yaxis_max = 100,is_xaxis_boundarygap = False,
         is_datazoom_show =True,line_width = 2,line_color = 'cyan',
         #=====設置markPoint&markLine=====
         mark_point = [
            {"coord": ['2018-09', 60], "name": "2018/09銷售目標"}, 
            {"coord": ['2018-11', 80], "name": "2018/10銷售目標"}]  # 自定義標記點
         )

line.render('result.折線圖示範.html')
line
開發者ID:gitxw,項目名稱:PythonStudy,代碼行數:30,代碼來源:折線圖.py


注:本文中的pyecharts.Line.render方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。