# Using Tab More Than Once Resizes Graph?

**URL:** <https://community.plotly.com/t/using-tab-more-than-once-resizes-graph/64626>\
**Category:** Dash Python\
**Tags:** question\
**Created:** [May 30, 2022, 5:25pm UTC](https://community.plotly.com/t/using-tab-more-than-once-resizes-graph/64626 "2022-05-30T17:25:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JustinB](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@JustinB](https://community.plotly.com/u/JustinB)\
**Post date:** [May 30, 2022, 5:25pm UTC](https://community.plotly.com/t/using-tab-more-than-once-resizes-graph/64626/1 "2022-05-30T17:25:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)\
**Post date:** [May 30, 2022, 6:37pm UTC](https://community.plotly.com/t/using-tab-more-than-once-resizes-graph/64626/2 "2022-05-30T18:37:44Z")

</div>

HI @JustinB

That’s a bug and it’s been reported [here](https://github.com/plotly/dash-core-components/issues/922)

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

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

```

---

<div class="post-metadata">

**Author:** ![JustinB](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@JustinB](https://community.plotly.com/u/JustinB)\
**Post date:** [May 30, 2022, 6:46pm UTC](https://community.plotly.com/t/using-tab-more-than-once-resizes-graph/64626/3 "2022-05-30T18:46:43Z")

</div>

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