Пример #1
0
def ratio3_box_graph(ticker, code, start_date, end_date):
    if start_date is not None and end_date is not None:
        data = func.getItems(collection_fs, ticker, start_date, end_date,
                             "Annual", "CAS", code)
        try:
            box = go.Box(y=data[code].tolist(), boxmean='sd')

            data = [box]

            fig = dict(data=data)
        except:
            fig = {}

    else:
        fig = {}
    return fig
Пример #2
0
def ratio3_graph(ticker, code, start_date, end_date):
    if start_date is not None and end_date is not None:
        data = func.getItems(collection_fs, ticker, start_date, end_date,
                             "Annual", "CAS", code)
        try:
            bar = go.Bar(
                x=data['Date'].tolist(),
                y=data[code].tolist(),
            )

            data = [bar]

            fig = dict(data=data)
        except:
            fig = {}

    else:
        fig = {}
    return fig