Using a Chart object with autoload_server()

I’m using Bokeh ‘0.6.1’ and I’m rendering a chart. I’d like to embed that chart into a HTML page that references the bokeh-server. I can do that with autoload_server() but that take as Plot object as input, not a Chart object. How can I accomplish this?

Example:

from bokeh.charts import TimeSeries
x = np.linspace(0,100,num=50)
y = np.random.randn(50)

data = OrderedDict({“xy”:np.hstack((x[:,np.newaxis],y[:,np.newaxis]))})
cht = TimeSeries(data,title=“Timeseries Test”,xlabel=“X”,ylabel=“Y”,legend=True,server=“fubar_plot”,notebook=True).show()

from bokeh.plotting import *
from bokeh.embed import autoload_server
from bokeh.session import Session

output_server(“fubar_plot”)
session = cursession()

script = autoload_server(cht, session)
print script

``

That code does not work because cht is a Chart not a Plot.

Just having trouble groking the difference.

Thanks!

-William

Hi William,

Chart object have a plot object that you can access and should do what you need. If you replace

···

script = autoload_server(cht, session)

with

script = autoload_server(cht.chart.plot, session)

Please note that this may change in the future as Charts inferface is still very experimental.

Let me know if it helps.

Fabio Pliger