Hi Community,
I have a px.timeline chart and I want the y axis lables as urls. Clicking on any of the axis lables should take you to that url.
Feel free to use the dummy code given below and suggest changes.
import plotly.express as px
import pandas as pd
df = pd.DataFrame(
[
dict(
Task="Job A",
Start="2009-01-01",
Finish="2009-02-28",
url="https://www.google.com",
),
dict(
Task="Job B",
Start="2009-03-05",
Finish="2009-04-15",
url="https://www.youtube.com",
),
dict(
Task="Job C",
Start="2009-02-20",
Finish="2009-05-30",
url="https://www.facebook.com",
),
]
)
fig = px.timeline(df, x_start="Start", x_end="Finish", y="Task")
fig.update_yaxes(autorange="reversed") # otherwise tasks are listed from the bottom up
fig.show()
Looking forward to hear from you guys.
Best,
Shail