Here’s a complete example code showing the problem: (The width is 3000 with horizontal scroll at first, after resizing the browser window the width changed to 1000)
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.graph_objs as go
app = dash.Dash(__name__)
app.layout = html.Div(
children=[
dcc.Input(id='input', type='text'),
html.Div(dcc.Graph(id='plot', style={'width': 1000, 'overflowY': 'scroll'})),
])
@app.callback(
Output('plot', 'figure'),
[Input('input', 'value')]
)
def update_graph_1(input):
return {'data':[go.Bar(
x=['Feature A', 'Feature B', 'Feature C',
'Feature D', 'Feature E', 'Feature F',
'Feature G', 'Feature H', 'Feature I',
'Feature J', 'Feature K', 'Feature L',
'Feature M', 'Feature N', 'Feature O',
'Feature P', 'Feature Q', 'Feature R',
'Feature S', 'Feature T', 'Feature U'],
y=[20, 14, 23, 25, 22,
20, 14, 23, 25, 22,
20, 14, 23, 25, 22,
20, 14, 23, 25, 22, 33])],
'layout': go.Layout(width=3000)}
if __name__ == '__main__':
app.run_server(debug=True)