コード例 #1
0
def line_week_chart():
    url = "http://13.125.241.222:8080/api/user/active/weekly"
    d = {"startdate": str(date_active[0]), "enddate": str(date_active[1])}
    act_data = requests.get(url, data=d).text  #这里需要写data=XXX而不是直接给
    act_data = json.loads(act_data)
    trans_data = transfer_data(act_data)
    d = line_datazoom_slider(trans_data[0], trans_data[1], "周活跃用户")
    return d.dump_options_with_quotes()
コード例 #2
0
def line_month_chart():
    url = "http://13.125.241.222:8080/api/user/active/monthly"
    d = {"startdate": str(date_active[0]), "enddate": str(date_active[1])}
    act_data = requests.get(url, data=d).text
    print(type(act_data))
    act_data = json.loads(act_data)
    trans_data = transfer_data(act_data)
    d = line_datazoom_slider(trans_data[0], trans_data[1], "月活跃用户")
    return d.dump_options_with_quotes()
コード例 #3
0
def accu_line_chart():
    #print("累积用户表",date_acc)
    url = "http://13.125.241.222:8080/api/user/total"
    d = {"startdate": str(date_acc[0]), "enddate": str(date_acc[1])}
    acc_data = requests.get(url, data=d).text  #这里需要写data=XXX而不是直接给
    acc_data = json.loads(acc_data)
    trans_data = transfer_data(acc_data)
    d = line_datazoom_slider(trans_data[0], trans_data[1], "累积用户")
    return d.dump_options_with_quotes()
コード例 #4
0
ファイル: app.py プロジェクト: ZhangYuu/xiaoying-demo2
def line_day_chart(id):
    #print("日活用户表", date_active)
    if id == "user":
        url = "http://13.125.241.222:8080/api/user/active/daily"
        d = {"startdate": str(date_active[0]), "enddate": str(date_active[1])}
    else:
        url = "http://13.125.241.222:8080/api/user/active/daily/" + id
        d = {"startdate": str(book_active[0]), "enddate": str(book_active[1])}
    act_data = requests.get(url, data=d).text  #这里需要写data=XXX而不是直接给
    act_data = json.loads(act_data)
    trans_data = transfer_data(act_data)
    d = line_datazoom_slider(trans_data[0], trans_data[1], "日活跃用户")
    return d.dump_options_with_quotes()