Configuration parameter

Hey, Iโ€™m quite new to web development and iโ€™m trying to integrate plotly into my Django app.

The way Iโ€™m currently doing it is by creating a go.Figure(), adding a trace and layout, then converting it .to_html() and sending that to the frontend as a div.

Iโ€™m trying to set a configuration parameter but iโ€™m not sure how to do so, as all the examples I see use the config dictionairy in the .show() function:

fig = go.Figure()

config = {'scrollZoom': True}

        x=[1, 2, 3],
        y=[1, 3, 1]))

As Iโ€™m not using the .show() function, but converting the figure to an html object instead, how would i go about adding this parameter?


Hi @avimuni welcome to the forums.

I think, you can use the config parameter as kwarg. Did you try?

go.Figure().to_html(config={'scrollZoom': True})

Yes! canโ€™t believe I missed that.

1 Like