[Fixed] Error caused by Plotly upgrade?

I am trying to upgrade some meta data in the plotly figure. It worked before, but since the beginning of this month, I got error of TypeError: ‘NoneType’ does not support item assignment

I assume it’s caused by the plotly upgrade. What is a proper way to add meta data like title or shapes in a plotly figure now?

Code Sample:

  # fig.layout['margin'] = dict(l=45, r=10, t=30, b=30)
  # fig.layout['hovermode'] = 'closest'
  # fig.layout['hoverlabel_align'] = 'left'
  # fig.layout['xaxis'] = dict(showspikes=True)
  # fig.layout['yaxis'] = dict(showspikes=True)

Clone link:
share a copy of your app

This sounds like a bug on our part.

Try adding the line before that code.

fig.layout = fig.layout or {}

We’ll get that fixed and report back.

1 Like

Thanks! Your solution works well.

This should now be fixed

1 Like