# Slow chart loading after changing tabs

**URL:** <https://community.plotly.com/t/slow-chart-loading-after-changing-tabs/16432>\
**Category:** Dash Python\
**Created:** [December 4, 2018, 10:45am UTC](https://community.plotly.com/t/slow-chart-loading-after-changing-tabs/16432 "2018-12-04T10:45:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tookas92](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@tookas92](https://community.plotly.com/u/tookas92)\
**Post date:** [December 4, 2018, 10:45am UTC](https://community.plotly.com/t/slow-chart-loading-after-changing-tabs/16432/1 "2018-12-04T10:45:47Z")

</div>

I have a problem with slow chart loading after changing tabs. I am using live graph and everything was smooth while it was taking input like this:

```
@app.callback(Output('tgraph', 'figure'),
              [Input('twitt-symbols', 'value')],
              events=[Event('t-graph-update', 'interval')])

```

The `twitt-symbols` is `id` of `dcc.Input` but with this solution everytime I have switched the tabs, current input values were forgotten. So in the next solution I have used `dcc.Store` outside of tabs to store data about last input and used those callbacks:

```
@app.callback(Output('twitterstorage', 'data'),
              [Input('tweet-button', 'n_clicks')],
              [State('twitt-symbols', 'value')])
def update_symbols(n_clicks, inputvalue):
    data = inputvalue
    print('symbol', data)
    return data

@app.callback(Output('twitt-symbols', 'value'),
              [Input('twitterstorage', 'data')])
def update_symbols(data):
    return data

@app.callback(Output('tgraph', 'figure'),
              [Input('twitterstorage', 'data')],
              events=[Event('t-graph-update', 'interval')])
def update_tweet(symbol):

```

And everything works… but is slow. With first solution chart was already loaded right after changing tab but with the second solution I have to wait like 5-7sec before it loads. How to solve it? Is there any way to do it faster?  
PS My tabs are different .py files and i render them by:

```
@app.callback(Output("tab_content", "children"), [Input("tabs", "value")])
def render_content(tab):
    if tab == "analysis_tab":
        return analysis.layout
    elif tab == "settings_tab":
        return settings.layout
    else:
        return settings.layout
```
