Hi ,
I am trying to plot a line plot on top of gantt chart and need these lines to be grouped by a column from dataframe. However when adding a new trace on top of the gantt chart I am unable to add a group by something , which i can do when I just plot the lines using the px.line .
px.line(df_filtered, x=ātimestamp_verboseā, y=ācumulative_distā, color=āgroupsā,line_group=āgroupsā)
how do I write this same things as a scatter plot ?
This is my code for the plots ā¦ I need the scatter_trace to replicate the px.line
import plotly.express as px
import plotly.graph_objs as go
from plotly.offline import iplot
fig = plt.figure(figsize=(20,10))
fig = ff.create_gantt(df_v3_gantt, colors=colors, index_col=āResourceā, show_colorbar=False,
group_tasks=True,show_hover_fill=True,title=āTimeSpace Diagram only changes in v3_currStateā,
showgrid_x=True, showgrid_y=True,bar_width=0.5,height=700)
fig[ālayoutā][āyaxisā].update(range=[-300,300])
fig.update_xaxes(rangeslider_visible=True)
scatter_trace=dict(type=āscatterā,
x= df_id2[ātimestamp_verboseā],
y=df_id2[ādistance_along_path_changeā] )
fig.add_trace(scatter_trace)
iplot(fig)
Thanks,
Shruti