I have a Dataframe
Date Category Sum 0 2019-06-03 \"25M\" 34 1 2019-06-03 \"25M\" 60 2 2019-06-03 \"50M\" 23
I had the same problem with my graph. Just add the following to layout code:
xaxis=dict(type = "category")
Note: I have used import plotly.graph_objs as go and NOT import plotly.express as px
import plotly.graph_objs as go
import plotly.express as px
This worked for me. Hope it helps you too.