-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdata_dashboard.py
More file actions
41 lines (31 loc) · 880 Bytes
/
data_dashboard.py
File metadata and controls
41 lines (31 loc) · 880 Bytes
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
35
36
37
38
39
40
41
from dash import Dash, dcc, html, Input, Output
import plotly.express as px
import pandas as pd
df = pd.read_csv('./ecu_data.csv', header="infer")
print(df.head())
app = Dash(__name__)
app.layout = html.Div([
html.H4('ECU Data'),
dcc.Graph(id="line-charts-x-graph"),
dcc.Dropdown(
id="line-charts-x-checklist",
options=list(df.head()),
value=["RPM"],
multi=True
),
dcc.Dropdown(
id="line-charts-x-dropdown",
options=list(df.head()),
value=["Time (sec)"]
)
])
@app.callback(
Output("line-charts-x-graph", "figure"),
Input("line-charts-x-checklist", "value"),
Input("line-charts-x-dropdown", "value"))
def update_line_chart(header_values, x_axis):
fig = px.line(df,
x=x_axis, y=header_values)
return fig
if __name__ == "__main__":
app.run_server(debug=True)