
I try update vbar_stack using ds.stream as below code
i = 1
ds = ColumnDataSource({"x": ['0', '1'], "d1": [0, 2], "d2": [0, 1]})
colors = ['red', 'green']
def update():
# print('calling update')
global i
i += 1
ds.stream({'x': [str(i)], 'd1': [np.random.randint(1, 3)], 'd2': [np.random.randint(1, 3)]})
print(ds.data)
def bkapp(doc):
p = figure(x_range=ds.data['x'], height=250)
p.vbar_stack(['d1', 'd2'], x='x', width=0.5, color=colors, source=ds)
doc.add_root(column(p))
doc.add_periodic_callback(update, 1000)
server = Server({'/': bkapp}, num_procs=1)
server.start()
if __name__ == '__main__':
print('Opening Bokeh application on http://localhost:5006/')
server.io_loop.add_callback(server.show, "/")
server.io_loop.start()
Initial data is well done with vbar_stack but update didn’t operation.
This problem also uploaded stackoverflow.
stackoverflow link : Can not updated vbar_stack with stream data with python bokeh

