Reputation: 1276
From Painless Streaming Plots with Bokeh it shows how to stream live data of a single variable. How do you stream multiple lines where there is more than one y variable.
import time
from bokeh.objects import GlyphRenderer
renderer = [r for r in curplot().renderers if isinstance(r, GlyphRenderer)][0]
ds = renderer.data_source
while True:
df = pd.io.json.read_json(url+json_call)
ds.data["x"] = x+N*i
ds.data["y"] = df.rssi
ds._dirty = True
session().store_obj(ds)
time.sleep(1.5)
i+=1
Upvotes: 5
Views: 1476
Reputation: 1638
You can update many ds.data[]
items before calling session().store_objs(ds)
.
Upvotes: 4