graph_objs.Ohlc showing empty chart through FigureWidget() in JupyterLab

line chart and others do work, only ohlc type displays empty chart

  • Python Packages
    • plotly==3.4.0
    • ipywidgets>=7.2
    • notebook>=5.3
    • jupyterlab==0.35
  • JupyterLab Extensions
    • plotlywidget@0.5.0
    • @jupyter-widgets/jupyterlab-manager@0.38
    • @jupyterlab/plotly-extension@0.18

Hi @ctypsy,

I think youโ€™re running into https://github.com/plotly/plotly.js/issues/3339, which affected both candlestick and OHLC traces when the open, high, low, close, properties were set to pandas series or numpy arrays. This was fixed in plotly.js 1.43.0 and released in plotly.py version 3.5.0.

Could you try updating and see if that takes care of the problem? If you arenโ€™t able to upgrade, you can work around the problem by converting these arrays to Python lists with the pandas tolist() method.

Hope that helps!
-Jon

@jmmease youโ€™re awesome!
I went for tolist() solution since updating plotly to 3.5.0 returns errors when trying to use iplot in JupyterLab. Iโ€™m using 3.4.0, referencing to compatibility requirements for JupyterLab from plotly.py/CHANGELOG.md at master ยท plotly/plotly.py ยท GitHub

Glad thatโ€™s working for you! BTW, the current compatible versions of libraries for use in JupyterLab is available in the README at https://github.com/plotly/plotly.py/blob/master/README.md#jupyterlab-support-python-35. But this reminds me that we should update the CHANGELOG to include these versions for each release again.

-Jon

Thank you very much for the relevant link. Youโ€™ve been very helpful!

  • Luka