Hi I have 2 graphs.
1st graph : Gps plots. (x-axis : Longitude, Y-axis: Latitude, text: Time in seconds)
2nd graph : some analysis plot (x-axis : Time in seconds)
When I hover on the plot of 2nd graph, plot on 1st graph with same value (text: Time in seconds) should be highlighted. Below is the code block and the figure with 2 graphs.
Please assist me with this.
def plot_map(self):
app = dash.Dash()
df = pd.read_csv(‘csv_files\combine.csv’)
df.head()
time = df[‘time’]
rasp_time = df[‘rasp_time’]
latitude = df[‘latitude’]
longitude = df[‘longitude’]
data = [
go.Scattermapbox(
lat=latitude,
lon=longitude,
text=rasp_time,
mode=‘markers’,
marker=dict(size=8))
]
layout = go.Layout(
autosize=True,
hovermode=‘closest’,
mapbox=dict(
bearing=0,
accesstoken=mapbox_access_token,
center=dict(lat=48.5069, lon=9.2038),
pitch=0,
zoom=12.5)
)
data2 = [{‘x’: time, ‘y’: rasp_time}]
layout2 = go.Layout(autosize=True, hovermode=‘closest’)
fig = dict(data=data, layout=layout)
fig2 = dict(data=data2, layout=layout2)
app.layout = html.Div([
dcc.Graph(id=‘graph’, figure=fig),
dcc.Graph(id=‘sa’, figure=fig2)
])
app.run_server(debug=True)