예제 #1
0
def search():
    #获取用户输入值
    values = get_value()
    print(values)
    graph_type=values.get("graph_type")
    #创建绘图对象
    chart = Chart_Plot(start_date=values.get("start_date"), end_date=values.get("end_date"),stock1=values.get("stock_id"), stock2=values.get("stock_id2"))
    if graph_type=="半年线图":
        context['graph'] = chart.twoline_graph()
    elif graph_type=="k线图":
        context['graph'] = chart.candle_stick(values.get("period"))
    elif graph_type=="高低点":
        context['graph'] = chart.high_low()

    return render_template("chars.html", title='Home', context=context)
예제 #2
0
def search():
    # 获取用户输入值
    values = get_value()
    print(values)
    graph_type = values.get("graph_type")
    # 创建绘图对象
    chart = Chart_Plot(**values)
    if graph_type == "半年线图":
        context['graph'], context["title"] = chart.twoline_graph()
    elif graph_type == "k线图":
        context['graph'], context["title"] = chart.candle_stick(
            values.get("period"))
    elif graph_type == "高低点":
        context['graph'], context["title"] = chart.high_low()
    elif graph_type == "市盈率":
        context['graph'], context["title"] = chart.plot_pes()
    elif graph_type == "振幅对比":
        context['graph'], context["title"] = chart.plot_amplitude()
    elif graph_type == "AH股价比":
        context['graph'], context["title"] = chart.plot_ah()
    return render_template("chars.html", title='Home', context=context)