Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Creating multiple graphs that updates on interval

Hi,

I have multiple graphs in dash that updates on an interval. When I have one graph it seems to update fine, but when I have multiple the graphs don’t update and doesnt even load for the first time.

Am I supposed to use one interval for all of them or a different one?

    dcc.Graph(id='example-graph1', style={'height': "25%"}),
    dcc.Graph(id='example-graph2', style={'height': "25%"}),
    dcc.Graph(id='example-graph3', style={'height': "25%"}),
    dcc.Graph(id='example-graph4', style={'height': "25%"}),
    dcc.Interval(
        id='interval-component1',
        interval=1 * 1000  # in milliseconds
    ),
    dcc.Interval(
        id='interval-component2',
        interval=1 * 1000  # in milliseconds
    ),
    dcc.Interval(
        id='interval-component3',
        interval=1 * 1000  # in milliseconds
    ),
    dcc.Interval(
        id='interval-component4',
        interval=1 * 1000  # in milliseconds
    )

you can use a single interval component to update each graph through a separate callback. you only need to use separate interval components if you want the components to update at different intervals.