I have used something similar for my work and it works:
for i in range(0, n_plots):
graph_init.append(html.Div(dcc.Graph(
style={'width': '100%', 'height': '100%'},
config={'displaylogo': False, 'editable': True, 'displayModeBar': False},
id='graph-{}'.format(i),
figure=dict(
data=[dict(
x=LAeq_all.iloc[:80000, 0], y=LAeq_all.iloc[:80000, 0], type='scattergl'
)],
layout=dict(
title='Figure ' + str(i + 1) + ': Measured Sound Level Time History',
font=dict(family='Arial, monospace', size=10),
autosize=True,
margin=dict(l=50, r=50, b=30, t=30, pad=0),
yaxis=dict(title='Month', linewidth=1, mirror=True),
xaxis=dict(title='Time', linewidth=1, mirror=True),
))
),
style={'height': 'calc(100% / ' + str(n_plots) + ')'}
))
Are you sure that the ids of the figures in the loop are unique? You cannot have multiple graphs with the same id. It usually renders it blank in that case