Open Prooffreader opened 8 years ago
after reading the source code, we got a solution: Jupyter highcharts在函数里不显示
it may work for your case.
import charts
def foo():
data = [1,2,5,9,6,3,4,8]
options = dict(height=400, title=dict(text='My first chart!'))
chart = charts.plot(series=data, options=options, name='List data', save='temp.svg', show='inline')
from IPython.display import HTML
chart = HTML('<h1>hello world</h1>' + chart.data)
return {'chart': chart, 'what_ever': 123}
d = foo()
d['chart']
and another solution: http://suanfazu.com/t/jupyter-highcharts/13438/2
def bar():
from IPython.display import display
chart = HTML('<h1>Hello, world!</h1>')
# or chart = charts.plot(...)
display(chart)
bar()
As soon as I wrap a working example within a class, nothing displays: