Black Lives Matter. Please consider donating to Black Girls Code today.

Stacked area chart

Hello,

I would like to create a filled area chart in Dash (like here). When creating the chart in Plot.ly it works well and looks like it should:

However, the same code produces a different result in Dash and the traces are not stacked anymore.

The code looks like this:

    for key, value in landusedata.items():
    traces.append(
        dict(
            x=xaxis,
            y=value,
            mode='lines',
            stackgroup='one',
            line=dict(
                width=1
            ),
        )
    )

layout = dict(font=dict(family='Aleo'))

##Plotly 
fig=dict(data=traces, layout=layout)
plotly.offline.plot(fig, filename='lansduse_temp_plot_json.html')

##Dash
return {'data': traces, 'layout': layout}

Thanks for the help!

Which version of dash-core-components are you on?

1 Like

That was it! I updated Dash and Plotly but forgot about the core-components. Now it works fine. Thanks for the hint!