예제 #1
0
def hello():
    kDate = getKdata('600606', '2018-06-01', '2018-07-01')

    kDay = [d[0] for d in kDate]
    kValue = [[x[1], x[2], x[3], x[4]] for x in kDate]

    kAll = [[x[0], x[1], x[2], x[3], x[4]] for x in kDate]

    kline = Kline('600606' + " K 线图", width="400", height="300")
    kline.add("日K", kDay, kValue)
    return render_template("pyecharts.html",
                           myechart=kline.render_embed(),
                           host=REMOTE_HOST,
                           script_list=kline.get_js_dependencies(),
                           kAll=kAll)
예제 #2
0
def mykline():
    form = request.form
    stock = form.get('stock')
    beginDay = form.get('beginDay')
    endDay = form.get('endDay')
    # print(stock)

    kDate = getKdata(stock, beginDay, endDay)
    # print(kDate)

    kDay = [d[0] for d in kDate]
    kValue = [[x[1], x[2], x[3], x[4]] for x in kDate]

    kAll = [[x[0], x[1], x[2], x[3], x[4]] for x in kDate]

    kline = Kline(str(stock) + " K 线图", width="400", height="300")
    kline.add("日K", kDay, kValue)
    return render_template("pyecharts.html",
                           myechart=kline.render_embed(),
                           host=REMOTE_HOST,
                           script_list=kline.get_js_dependencies(),
                           kAll=kAll)