-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
34 lines (27 loc) · 802 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.express as px
import pandas as pd
df = px.data.stocks()
# df = pd.read_csv('C:/Users/halilerhan.orun/IdeaProjects/calisma1/sensor_no.csv')
app = dash.Dash(__name__)
app.layout = html.Div([
dcc.Dropdown(
id="ticker",
options=[{"label": x, "value": x}
for x in df.columns[1:]],
value=df.columns[1],
clearable=False,
),
dcc.Graph(id="time-series-chart"),
])
@app.callback(
Output("time-series-chart", "figure"),
[Input("ticker", "value")])
def display_time_series(ticker):
fig = px.line(df, x='date', y=ticker)
return fig
if __name__ == "__main__":
app.run_server(debug=True)