Skip to content

px.timeline() setting text to end column displays duration #3019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nicolaskruchten opened this issue Jan 12, 2021 · 1 comment
Closed

px.timeline() setting text to end column displays duration #3019

nicolaskruchten opened this issue Jan 12, 2021 · 1 comment
Milestone

Comments

@nicolaskruchten
Copy link
Contributor

Broken off of #2934... Here the text will be the computed delta value because PX rewrites the data frame and reuses the column name Finish for x:

import plotly.express as px
import pandas as pd

df = pd.DataFrame([
    dict(Task="Job A", Start='2009-01-01', Finish='2009-02-28', Resource="Alex"),
    dict(Task="Job B", Start='2009-03-05', Finish='2009-04-15', Resource="Alex"),
    dict(Task="Job C", Start='2009-02-20', Finish='2009-05-30', Resource="Max")
])
fig = px.timeline(df, x_start="Start", x_end="Finish", y="Task", text="Finish")
fig.update_yaxes(autorange="reversed")
fig.show()

The current unfortunate workaround is to set text=df["Finish"]+"" which causes a separate column to be created in the internal data frame.

@nicolaskruchten nicolaskruchten added this to the v4.x milestone Jan 12, 2021
@gvwilson
Copy link
Contributor

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants