-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathline_chart_visualization.py
48 lines (42 loc) · 1.27 KB
/
line_chart_visualization.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
35
36
37
38
39
40
41
42
43
44
45
46
47
from dash import Dash, dcc, html
import pandas as pd
app = Dash(__name__)
df = pd.read_csv ('example_data.csv', sep =' ')
df2 = df.set_axis(['Time', 'Power', 'Robot'], axis=1, inplace=False)
app.layout = html.Div([
dcc.Graph(
figure=dict(
data=[
dict(
x=df2['Time'],
y=df2['Power'].loc[df2['Robot']=='robot1'],#df.loc[df['column_name'] == some_value]
name='Robot 1',
marker=dict(
color='rgb(55, 83, 109)'
)
),
dict(
x=df2['Time'],
y=df2['Power'].loc[df2['Robot']=='robot2'],#df.loc[df['column_name'] == some_value]
name='Robot 2',
marker=dict(
color='rgb(26, 118, 255)'
)
)
],
layout=dict(
title='Robot Power',
showlegend=True,
legend=dict(
x=0,
y=1.0
),
margin=dict(l=40, r=0, t=40, b=30)
)
),
style={'height': 300},
id='my-graph'
)
])
if __name__ == '__main__':
app.run_server(debug=True)