Black Lives Matter. Please consider donating to Black Girls Code today.
Dash Enterprise delivers an incredible 21x cost savings 💸Download the e-book!

Adjusting the size of graphs

Hi,

I want to adjust the size of the graphs to fit a window so I tried the following:

    html.Div([
    dcc.Graph(id='example-graph1')
    ],  style={"height" : "25%", "width" : "100%"}),

I also tried this:
dcc.Graph(id='example-graph2', className='hm'),

with css here

https://codepen.io/dynamitedu/pen/zPeVzE.css

Neither seems to work. Any ideas?

1 Like

See Can't seem to change default Height on Graph

If you want it to fit the window, you might try 'height': '80vh'instead of %. Note that % is always in reference to the parent container, which may or may not have a height defined for it.

I’d also recommend adjusting this / playing around with this with your browser’s Development Tools.

2 Likes