I want to create a bar chart using python plotly, with on the x-axis dates as strings/categories. For some reason, plotly keeps transforming strings to dates. My x-axis is continuous "timeline" of dates, rather than categories as I would expect.
My question: how can I construct a bar chart where my dates are handled as categories, rather than dates?
Minimal example:
d = {'date': ['2018-08-04', '2018-08-02','2018-08-03', '2018-08-11','2018-08-11'], 'score': [3, 4, 6, 2,8]}
df = pd.DataFrame(data=d)
data = [go.Bar(
x=df['date'],
y=df['score']
)]
offline.iplot(data, filename='basic-bar')
Example: