tickvalsshould be the actual x-axis values ββwhere your ticks should be located, not the labels. Not knowing what your actual data looks like, here is an example with some compiled data:
self.months = ['2017-01-01', '2017-02-01', '2017-03-01']
self.data = [
{'x': [0, 1, 2], 'y': [4, 1, 2], 'type': 'bar', 'name': 'SF'},
{'x': [0, 1, 2], 'y': [2, 4, 5], 'type': 'bar', 'name': u'MontrΓ©al'},
]
self.tickvals = [0, 1, 2]
def plot_bar(self):
app.layout = html.Div(children=[html.H1(children=''), html.Div(children='Discovered monthly'),
dcc.Graph(
figure=go.Figure(
data = self.data,
layout=go.Layout(
title='Streams', showlegend=True, barmode='stack', margin=go.Margin(l=200, r=0, t=40, b=20),
xaxis=dict(tickvals = self.tickvals, ticktext = self.months, title='months')
)
),
style={'height': 300},
id='my-graph')
])
, 2017-01-01 0, 2017-02-01 1 2017-03-01 2 x. 2017-02-01 (, , 1 self.tickvals) , , 1.5, . , .