px.timeline chart incorrectly displays timeframes of 10 seconds and smaller.
See original GitHub issueThe following piece of python code that uses a ISO-formatted date string produces the graph below.
import plotly.express as px
import pandas as pd
bars = pd.DataFrame([{'Task': 'kitter_pick', 'Start': '2020-07-22T23:09:18.221013', 'Finish': '2020-07-22T23:09:25.221013', 'Counter': 2465}])
fig = px.timeline(bars, x_start="Start", x_end="Finish", y="Task",hover_name='Counter')
fig.update_yaxes(autorange="reversed") # otherwise tasks are listed from the bottom up
fig.show()
result The snippet is similar to https://plotly.com/python/time-series/ from the plotly documentation.
The timescale is completely incorrect due to the finish attribute being incorrectly interpreted by plotly.
When changing the timestrings slightly you obtain the correct result:
bars = pd.DataFrame([{'Task': 'kitter_pick', 'Start': '2020-07-22T23:09:18.221013', 'Finish': '2020-07-22T23:10:25.221013', 'Counter': 2465}])
Does anybody know why this happens and if there is a way around this?
I have also tried:
- datetime.datetime objects
- np.datetime64 objects
Both gave the same results
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Plotly px.timeline not working with specific combinations of ...
However, this issue was resolved in plotly release 4.11 (px.timeline chart incorrectly displays timeframes of 10 seconds and smaller.
Read more >Plotly Express timeline for Gantt Chart with integer xaxis?
The answer: Yes, it's possible! Just give integers as start and end "dates", calculate the difference between them ( delta ), and make...
Read more >Change the timescale in a Project view in Project desktop
Display a view with a timescale, such as the Gantt Chart. Click View > Timescale box arrow. Timescale box on the View tab....
Read more >Visualization: Column Chart - Google Developers
Like all Google charts, column charts display tooltips when the user hovers over the data. For a horizontal version of this chart, see...
Read more >Year 2000 problem - Wikipedia
The year 2000 problem, also known as the Y2K problem, Y2K scare, millennium bug, Y2K bug, Y2K glitch, Y2K error, or simply Y2K...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed on master.
Should be fixed in the next version of
plotly
, within 10 days.