Using Tab More Than Once Resizes Graph?

Hi All,

I have 4 tabs, each with a different chart which I’ve set to a specific height using a single variable (chartHeight = 750). I works fine when the pages loads and when I click on each tab. The problem arises when I click on each tab again, that’s when the graph height reverts back to the default size. I’ve tried moving the variable out of the callbacks, but that hasn’t helped either. Even when I hard code the Height, it reverts. It’s a strange problem and Google hasn’t been able to help me.

Any thoughts?

Thanks in advance.

HI @JustinB

That’s a bug and it’s been reported here

The workaround is to set the figure height in dcc.Graph, rather than in the figure. For example

dcc.Graph(figure=fig, style{"height":750})

Thanks, it works! It felt like a bug since I wasn’t doing anything exotic.

1 Like