I have a use case where I pull and plot Forex
data in the form of ask and bid
on the graph and this is based on minute, hour or day candlesti
Using category as the xaxis type worked for me quite nicely (notice the go.Layout object):
import plotly.graph_objects as go
layout = go.Layout(
xaxis=dict(
type='category',
)
)
fig = go.Figure(data=[go.Candlestick(x=self.price_df.index.to_series(),
open=self.price_df[e.OHLCV.OPEN.value],
high=self.price_df[e.OHLCV.HIGH.value],
low=self.price_df[e.OHLCV.LOW.value],
close=self.price_df[e.OHLCV.CLOSE.value])],
layout=layout)
fig.show()