Hello,
when graphs are in tabs (using Bootstrap), the graphs in tabs not shown will not take the all screen as expected. The example below shows the issue. If the browser windows is changed, the graphs in the tab will take the proper full screen dimensions.
I tried to solve this in all ways but none were working.
Here is the code of an example:
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as goapp = dash.Dash(name, external_stylesheets=[dbc.themes.BOOTSTRAP])
fig = go.Figure(
data=[
go.Bar(
x=[1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012],
y=[219, 146, 112, 127, 124, 180, 236, 207, 236, 263,
350, 430, 474, 526, 488, 537, 500, 439],
name=âRest of worldâ,
),
],
)tab1 = [
html.Br(),
dbc.Row(dbc.Col(dcc.Graph(figure=fig))),
]tab2 = [
html.Br(),
dbc.Row(dbc.Col(dcc.Graph(figure=fig))),
]body_rows = html.Div([
dbc.Tabs([
dbc.Tab(tab1, label=âTab1â),
dbc.Tab(tab2, label=âTab2â),
], active_tab=âtab-1â),])
body = dbc.Container([body_rows], fluid=False)
app.layout = html.Div([body])
if name == âmainâ:
app.run_server(debug=True)
Thanks for your help and congratulations for plotly and dash, you are making a wonderfull job.
Salvatore