Goal: To combine 2 timelines together
Issue: add_traces() does NOT render ‘colors’ key for second timeline, just a single color
I can properly create the 1st timeline with no issues; however, adding the 2nd has been challenging. There’s very little guidance online explicitly on px.timeline – help would be really appreciated, in terms of what’s ‘best practice’ when combining px. timelines.
import plotly.express as px
import plotly.graph_objects as go
purpose = px.timeline(timeline, x_start='START', x_end='END', y=timeline.index, color='PURPOSE')
source = px.timeline(timeline, x_start='START', x_end='END', y=timeline.index, color='SQLsource')
fig = go.Figure(purpose)
fig.add_trace(source.data[0])
#fig.layout = source.layout --------- doesn't seem to change anything?
Legend shows single discrete variable from my 2nd timeline, ‘CSR Form’ — the former all belong to the 1st timeline.