문제

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
도움이 되었습니까?

해결책

You can update many ds.data[] items before calling session().store_objs(ds).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top