☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

How can I specify a bokeh server ip for a TimeSeries object

Community Support
alberto.totalmar
alberto.totalmar

Hello
I have code working that plots time series objects in a bokeh server running in localhost. However, I would like to send it to a server on a specific ip. Using lower level object and doing:
output_server(‘Plot name’, url=‘http://someURL:5006/’, clear=True) seem to work just fine. But, TimeSeries still tries to connect to localhost.
Looking a little inside the code it seems to me that there is no simple way of either setting the ip or passing a session to bokeh.charts objects. Is this correct? Is there no way to specify a server in which to plot high level charts?

⌁   Link to post
Fabio_Pliger
Fabio_Pliger

Hi Alberto,

Yes, it’s a bit tricky at the moment. There are several improvements to the charts interface that are going to be shipped with the next release (so 0.8) and things are going to be a lot easier. You can do the following workaround with the current 0.7.1 release (modified version of the stocks_timeseries.py example to connect to a bokeh-server listening on port 5522):

from collections import OrderedDict
import pandas as pd
from bokeh.charts import TimeSeries
from bokeh.session import Session

Here is some code to read in some stock data from the Yahoo Finance API

AAPL = pd.read_csv(
“http://ichart.yahoo.com/table.csv?s=AAPL&a=0&b=1&c=2000&d=0&e=1&f=2010”,
parse_dates=[‘Date’])
MSFT = pd.read_csv(
“http://ichart.yahoo.com/table.csv?s=MSFT&a=0&b=1&c=2000&d=0&e=1&f=2010”,
parse_dates=[‘Date’])
IBM = pd.read_csv(
“http://ichart.yahoo.com/table.csv?s=IBM&a=0&b=1&c=2000&d=0&e=1&f=2010”,
parse_dates=[‘Date’])

xyvalues = OrderedDict(
AAPL=AAPL[‘Adj Close’],
Date=AAPL[‘Date’],
MSFT=MSFT[‘Adj Close’],
IBM=IBM[‘Adj Close’],
)

TOOLS=“resize,pan,wheel_zoom,box_zoom,reset,previewsave”
ts = TimeSeries(xyvalues, index=‘Date’, title=“timeseries, pd_input”, tools=TOOLS, ylabel=‘Stock Prices’, server=“newserver”)
ts.session = Session(root_url=“http://localhost:5522/”)
ts.legend(“top_left”).show()

``

I hope this helps.

Thanks for you interest!

Fabio

···

On Wednesday, January 21, 2015 at 5:36:47 PM UTC+1, alberto....@gmail.com wrote:

Hello
I have code working that plots time series objects in a bokeh server running in localhost. However, I would like to send it to a server on a specific ip. Using lower level object and doing:
output_server(‘Plot name’, url=‘http://someURL:5006/’, clear=True) seem to work just fine. But, TimeSeries still tries to connect to localhost.
Looking a little inside the code it seems to me that there is no simple way of either setting the ip or passing a session to bokeh.charts objects. Is this correct? Is there no way to specify a server in which to plot high level charts?

⌁   Link to post

End of archived discussion · Replies are disabled